应用程序崩溃与NoClassDefFoundError'仅适用于Android 4.x.

时间:2015-08-05 10:05:28

标签: android

在运行我的项目时,我收到了一系列此类型或错误:在较低的Android版本上https://github.com/evercam/evercam-play-android(在HTC One X上测试 - 4.1.1&& Galaxy S3 - 4.3模拟器和两次崩溃) 。但它适用于Android 5。

在创建Runnable对象时似乎发生了所有崩溃,但我无法弄清楚原因。我通过删除runnables解决了其他一些类似的崩溃,但总会出现新的错误。

知道这里可能出现什么问题吗?非常感谢!

我正在使用Android Studio 1.3,这是包含最新错误的日志:

08-05 05:28:51.071    3080-3080/? E/dalvikvm﹕ Could not find class 'io.evercam.androidapp.custom.CameraLayout$3', referenced from method io.evercam.androidapp.custom.CameraLayout.<init>
08-05 05:28:51.071    3080-3080/? W/dalvikvm﹕ VFY: unable to resolve new-instance 6631 (Lio/evercam/androidapp/custom/CameraLayout$3;) in Lio/evercam/androidapp/custom/CameraLayout;
08-05 05:28:51.071    3080-3080/? D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0019
08-05 05:28:51.071    3080-3080/? W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lio/evercam/androidapp/custom/GradientTitleLayout;)
08-05 05:28:51.071    3080-3080/? E/dalvikvm﹕ Could not find class 'io.evercam.androidapp.custom.CameraLayout$2', referenced from method io.evercam.androidapp.custom.CameraLayout.showOfflineIcon
08-05 05:28:51.071    3080-3080/? W/dalvikvm﹕ VFY: unable to resolve new-instance 6630 (Lio/evercam/androidapp/custom/CameraLayout$2;) in Lio/evercam/androidapp/custom/CameraLayout;
08-05 05:28:51.071    3080-3080/? D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0005
08-05 05:28:51.071    3080-3080/? I/dalvikvm﹕ Could not find method io.evercam.androidapp.custom.GradientTitleLayout.getOfflineImageView, referenced from method io.evercam.androidapp.custom.CameraLayout.getOfflineIconBounds
08-05 05:28:51.071    3080-3080/? W/dalvikvm﹕ VFY: unable to resolve virtual method 44814: Lio/evercam/androidapp/custom/GradientTitleLayout;.getOfflineImageView ()Landroid/widget/ImageView;
08-05 05:28:51.071    3080-3080/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0007
08-05 05:28:51.075    3080-3080/? I/dalvikvm﹕ Could not find method io.evercam.androidapp.custom.GradientTitleLayout.removeGradientShadow, referenced from method io.evercam.androidapp.custom.CameraLayout.showThumbnail
08-05 05:28:51.075    3080-3080/? W/dalvikvm﹕ VFY: unable to resolve virtual method 44815: Lio/evercam/androidapp/custom/GradientTitleLayout;.removeGradientShadow ()V
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0057
08-05 05:28:51.075    3080-3080/? I/dalvikvm﹕ Could not find method io.evercam.androidapp.custom.GradientTitleLayout.setTitle, referenced from method io.evercam.androidapp.custom.CameraLayout.updateTitleIfDifferent
08-05 05:28:51.075    3080-3080/? W/dalvikvm﹕ VFY: unable to resolve virtual method 44816: Lio/evercam/androidapp/custom/GradientTitleLayout;.setTitle (Ljava/lang/String;)V
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0028
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0xaeaa at 0x1b in Lio/evercam/androidapp/custom/CameraLayout;.<init>
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0xaf0d at 0xdf in Lio/evercam/androidapp/custom/CameraLayout;.<init>
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0xaea8 at 0x105 in Lio/evercam/androidapp/custom/CameraLayout;.<init>
08-05 05:28:51.075    3080-3080/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0xaea9 at 0x07 in Lio/evercam/androidapp/custom/CameraLayout;.showOfflineIcon
08-05 05:28:51.075    3080-3080/? D/AndroidRuntime﹕ Shutting down VM
08-05 05:28:51.075    3080-3080/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xa4b68648)
08-05 05:28:52.767    3080-3104/io.evercam.androidapp D/dalvikvm﹕ GC_FOR_ALLOC freed 778K, 7% free 12359K/13164K, paused 7ms, total 7ms
08-05 05:28:54.083    3080-3080/io.evercam.androidapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: io.evercam.androidapp.custom.CameraLayout$3
            at io.evercam.androidapp.custom.CameraLayout.<init>(CameraLayout.java:256)
            at io.evercam.androidapp.CamerasActivity.addAllCameraViews(CamerasActivity.java:439)
            at io.evercam.androidapp.CamerasActivity$1.run(CamerasActivity.java:123)
            at android.os.Handler.handleCallback(Handler.java:730)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
08-05 05:31:12.083    3080-3080/? I/Process﹕ Sending signal. PID: 3080 SIG: 9

2 个答案:

答案 0 :(得分:1)

原因是我没有完全实现Multidex,这与NoClassDefFoundError with Android Studio on Android 4

的问题相同

在defaultConfig中设置multiDexEnabled = true后,需要进行更多更改:

  1. 在build.gradle中包含compile 'com.android.support:multidex:1.0.1'
  2. 使Application类扩展MultiDexApplication而不仅仅是Application。

答案 1 :(得分:0)

Please, check this issue,基本上是将lib重命名为依赖项中的lib。从显示的错误中,this problem正在发生,因为类文件不存在或无法加载,请检查Lio/evercam/androidapp/custom/GradientTitleLayout是否存在