非常感谢您在这里停留。
我正在为我的Android应用实施工具崩溃。这工作正常,直到我为插件崩溃添加了必要的工具。在这种情况下,它是带有phonegap(Cordova)的Android应用程序的批评。
目前,应用程序无法启动,我在LogCat中收到以下消息:
07-22 10:42:34.710: W/dalvikvm(8296): VFY: unable to resolve static method 512: Landroid/webkit/WebView;.setWebContentsDebuggingEnabled (Z)V
07-22 10:42:34.770: W/System.err(8296): java.lang.ClassNotFoundException: org.apache.cordova.whitelist.WhitelistPlugin
07-22 10:42:34.770: W/System.err(8296): at java.lang.Class.classForName(Native Method)
07-22 10:42:34.770: W/System.err(8296): at java.lang.Class.forName(Class.java:217)
07-22 10:42:34.770: W/System.err(8296): at java.lang.Class.forName(Class.java:172)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:345)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:189)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:114)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.PluginManager.init(PluginManager.java:92)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:383)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:368)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:344)
07-22 10:42:34.770: W/System.err(8296): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:389)
07-22 10:42:34.770: W/System.err(8296): at com.example.android.CordovaApp.onCreate(CordovaApp.java:34)
07-22 10:42:34.770: W/System.err(8296): at android.app.Activity.performCreate(Activity.java:5104)
07-22 10:42:34.770: W/System.err(8296): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-22 10:42:34.770: W/System.err(8296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
07-22 10:42:34.770: W/System.err(8296): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-22 10:42:34.770: W/System.err(8296): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-22 10:42:34.770: W/System.err(8296): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-22 10:42:34.770: W/System.err(8296): at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 10:42:34.770: W/System.err(8296): at android.os.Looper.loop(Looper.java:137)
07-22 10:42:34.770: W/System.err(8296): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-22 10:42:34.770: W/System.err(8296): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 10:42:34.770: W/System.err(8296): at java.lang.reflect.Method.invoke(Method.java:511)
07-22 10:42:34.770: W/System.err(8296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-22 10:42:34.770: W/System.err(8296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-22 10:42:34.770: W/System.err(8296): at dalvik.system.NativeStart.main(Native Method)
07-22 10:42:34.770: W/System.err(8296): Caused by: java.lang.NoClassDefFoundError: org/apache/cordova/whitelist/WhitelistPlugin
07-22 10:42:34.780: W/System.err(8296): ... 26 more
07-22 10:42:34.780: W/System.err(8296): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.cordova.whitelist.WhitelistPlugin" on path: /data/app/com.example.android-1.apk
07-22 10:42:34.780: W/System.err(8296): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-22 10:42:34.780: W/System.err(8296): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-22 10:42:34.780: W/System.err(8296): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-22 10:42:34.780: W/System.err(8296): ... 26 more
07-22 10:42:34.780: W/dalvikvm(8296): threadid=1: thread exiting with uncaught exception (group=0x416da930)
07-22 10:42:34.780: E/AndroidRuntime(8296): FATAL EXCEPTION: main
07-22 10:42:34.780: E/AndroidRuntime(8296): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android/com.example.android.CordovaApp}: java.lang.NullPointerException
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.os.Looper.loop(Looper.java:137)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-22 10:42:34.780: E/AndroidRuntime(8296): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 10:42:34.780: E/AndroidRuntime(8296): at java.lang.reflect.Method.invoke(Method.java:511)
07-22 10:42:34.780: E/AndroidRuntime(8296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-22 10:42:34.780: E/AndroidRuntime(8296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-22 10:42:34.780: E/AndroidRuntime(8296): at dalvik.system.NativeStart.main(Native Method)
07-22 10:42:34.780: E/AndroidRuntime(8296): Caused by: java.lang.NullPointerException
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:191)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:114)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.PluginManager.init(PluginManager.java:92)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:383)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:368)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:344)
07-22 10:42:34.780: E/AndroidRuntime(8296): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:389)
07-22 10:42:34.780: E/AndroidRuntime(8296): at com.example.android.CordovaApp.onCreate(CordovaApp.java:34)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.Activity.performCreate(Activity.java:5104)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-22 10:42:34.780: E/AndroidRuntime(8296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
07-22 10:42:34.780: E/AndroidRuntime(8296): ... 11 more
我的程序的主要流程如下:
public class CordovaApp extends CordovaActivity{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
非常感谢你的帮助
问候