尝试使用Cordova安装插件时出错

时间:2018-03-15 09:07:42

标签: android cordova

我对Cordova和跨平台编程有点新意。我已经按照互联网上的教程进行了操作,但我仍然坚持使用插件安装插件。我想在我的应用程序上使用相机,所以我尝试运行此命令行:

plugman install --platform android --project hello --plugin cordova-plugin-camera

我收到此错误消息:

cordova-android version not detected (lacks script "/Users/XXX/Documents/cordova/hello/hello/cordova/version" ), continuing.
Unable to load PlatformApi from platform. Error: Cannot find module '/Users/XXX/Documents/cordova/hello/hello/cordova/Api.js'
The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.
Failed to install 'cordova-plugin-camera': Error: Your android platform does not have Api.js

我已尝试过在论坛上看到的一些内容,但我找不到任何解决方案。
我在版本8.0.0上运行Cordova并满足所有要求 谢谢!

2 个答案:

答案 0 :(得分:2)

不要使用plugman来安装插件,使用Cordova CLI来安装插件。

从项目文件夹中,运行

@MappedSuperclass
class BasicEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", length = 25)
    private String id;

    @Column(name = "name", nullable = false)
    private String name;
    ....
};

@Entity
@Table(name = "entity_0")
public final class Entity0 extends BasicEntity {
};

@Entity
@Table(name = "entity_1")
public final class Entity1 extends BasicEntity {
   @Column(name = "foo")
   private long foo;
};

答案 1 :(得分:0)

如果您正在进行的项目是Ionic,则命令应为:

ionic cordova plugin add cordova-plugin-camera
相关问题