phonegap项目到android gradle项目

时间:2016-06-08 10:01:04

标签: java android apache cordova phonegap-plugins

我正借助以下链接将PhoneGap项目转换为gradle项目:

http://www.catharinegeek.com/embed-cordova-webview-in-android-native-app/

但是我在打开应用时遇到错误

java.lang.RuntimeException:无法启动活动ComponentInfo {com.sellout.selloutzone.sellout / com.sellout.selloutzone.sellout.MainActivity}:java.lang.NullPointerException:尝试调用虚方法'void null对象引用上的org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String,org.apache.cordova.CordovaInterface,org.apache.cordova.CordovaWebView,org.apache.cordova.CordovaPreferences)'                                                                                    在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3190)                                                                                    在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300)                                                                                    在android.app.ActivityThread.access $ 1000(ActivityThread.java:211)                                                                                    在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1705)                                                                                    在android.os.Handler.dispatchMessage(Handler.java:102)                                                                                    在android.os.Looper.loop(Looper.java:145)                                                                                    在android.app.ActivityThread.main(ActivityThread.java:6946)                                                                                    at java.lang.reflect.Method.invoke(Native Method)                                                                                    在java.lang.reflect.Method.invoke(Method.java:372)                                                                                    在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1404)                                                                                    在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)                                                                                 引起:java.lang.NullPointerException:尝试调用虚方法'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String,org.apache.cordova.CordovaInterface,org.apache.cordova.CordovaWebView,org。 apache.cordova.CordovaPreferences)'对空对象引用                                                                                    在org.apache.cordova.PluginManager.getPlugin(PluginManager.java:172)                                                                                    在org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:98)                                                                                    在org.apache.cordova.PluginManager.init(PluginManager.java:87)                                                                                    在org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:116)                                                                                    在org.apache.cordova.CordovaActivity.init(CordovaActivity.java:144)                                                                                    在com.sellout.selloutzone.sellout.MainActivity.onCreate(MainActivity.java:14) 我搜索过的地方也跟着这些链接,但没有运气,请帮助我的朋友,我正在寻找超过2天的解决方案

https://github.com/jimmykobe1171/EmbeddedCorovaWebViewDemo/tree/master/EmbeddedCordovaWebViewDemo/app/src/main

Unfortunately cordova android App Stopped

Ionic app crashes on Android emulator and device

this is project structure

0 个答案:

没有答案