Error initializing Cordova: Class not found

后端 未结 13 1411
清歌不尽
清歌不尽 2020-12-14 00:09

I followed the tutorial of Phonegap from the official Phonegap.com site (getting started with Android).

I have created project with following all the steps.

13条回答
  •  抹茶落季
    2020-12-14 00:28

    I had this problem using phonegap 3.x and the problem turned out to be that phonegap hadn't properly installed the plugins, or they just messed up along the way. Basically when you install the plugins and build for a platform it takes the javascript files from plugins/org.apache.cordova.core.specific-plugin/www and puts them in platforms/android/assets/www/plugins/org.apache.cordova.core.specific-plugin/www and then it takes the Java files (or objective C for iOS) and puts them in platforms/android/src/org/apache/cordova/specificplugin

    And all of this is specified by plugins/org.apache.cordova.core.specific-plugin/plugin.xml. If you look in a plugins.xml you should see something like:

    
    

    So this tells you that in platforms/android/src/org/apache/cordova/networkinformation, there should be NetworkManager.java. And that file can be copied from plugins/org.apache.cordova.core.network-information/src/android/NetworkManager.java

    Now all of this is supposed to happen automatically without having to touch the platforms folder. But if it messes up you can fix it by manually copying the correct files into the correct folders.

提交回复
热议问题