我在Reactjs和ionic-react中有一个移动应用程序,我想向其添加深度链接,我已经安装了plugin请求的所有依赖项,该应用程序可以使用电容器正确编译,并且当我尝试打开它时在移动设备上跳过错误“不幸的是,应用已停止”。
这是日志:
W/System.err: java.lang.ClassNotFoundException: io.ionic.links.IonicDeeplink
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:489)
at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:169)
at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
W/System.err: at org.apache.cordova.PluginManager.init(PluginManager.java:86)
at com.getcapacitor.cordova.MockCordovaWebViewImpl.init(MockCordovaWebViewImpl.java:62)
at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:80)
at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:64)
at com.example.app.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6112)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$900(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5753)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ionic.links.IonicDeeplink" on path: DexPathList[[zip file "/data/app/com.example.app-2/base.apk", zip file "/data/app/com.example.app-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.app-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 24 more
Suppressed: java.lang.ClassNotFoundException: io.ionic.links.IonicDeeplink
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 25 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I/System.out: Error adding plugin io.ionic.links.IonicDeeplink.
D/AndroidRuntime: Shutting down VM
这是红色的:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.app, PID: 16432
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2656)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$900(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5753)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference
at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
at org.apache.cordova.PluginManager.init(PluginManager.java:86)
at com.getcapacitor.cordova.MockCordovaWebViewImpl.init(MockCordovaWebViewImpl.java:62)
at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:80)
at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:64)
at com.example.app.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6112)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$900(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5753)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Application terminated.