我在Android上使用Ionic構建的應用程序中使用深層鏈接。當我點擊鏈接時,應用程序打開,但只是一秒鐘後墜毀。我怎麼能調試這個問題?使用深層鏈接時應用程序崩潰
這是意圖代碼在AndroidManifest.xml:
<activity android:label="@string/app_name" android:name="com.pipp.deeplinks.LinkActivity" android:theme="@android:style/ Theme.DeviceDefault.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="pipp.app.com" android:pathPrefix="/news" android:scheme="http" />
<data android:host="actionnaires" android:scheme="pipp" />
</intent-filter>
</activity>
謝謝!
更新
使用Android Studio中,我有以下日誌:
10-13 11:10:24.633 20844-20844/com.pipp.actionnaires E/AndroidRuntime: FATAL EXCEPTION: main Process: com.pipp.actionnaires, PID: 20844 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.pipp.actionnaires/com.pipp.deeplinks.LinkActivity}: java.lang.ClassNotFoundException: Didn't find class "com.pipp.deeplinks.LinkActivity" on path: DexPathList[[zip file "/data/app/com.pipp.actionnaires-1/base.apk"],nativeLibraryDirectories=[/data/app/com.pipp.actionnaires-1/lib/x86, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.pipp.deeplinks.LinkActivity" on path: DexPathList[[zip file "/data/app/com.pipp.actionnaires-1/base.apk"],nativeLibraryDirectories=[/data/app/com.pipp.actionnaires-1/lib/x86, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1067) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Suppressed: java.lang.ClassNotFoundException: com.pipp.deeplinks.LinkActivity 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) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
粘貼相應的logcat跟蹤 –
你可以用android studio調試...並找到錯誤.. – Naitik
謝謝,我更新了錯誤的問題。你能告訴我如何解決它嗎? –