我正在尝试使用Androd Studio 2.3.1调试带有Samsung Galaxy S7(已安装Android 7.0)的应用程序(最小sdk 16,目标sdk 24),但出现以下异常,该应用程序停止运行:

com.venework.app.venework E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.venework.app.venework, PID: 3556
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.venework.app.venework/com.venework.app.venework.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.venework.app.venework.MainActivity" on path: DexPathList[[zip file "/data/app/com.venework.app.venework-1/base.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_9_apk.apk"],
    nativeLibraryDirectories=[/data/app/com.venework.app.venework-1/lib/arm64, /system/lib64, /vendor/lib64]]
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2844)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.venework.app.venework.MainActivity" on path: DexPathList[[zip file "/data/app/com.venework.app.venework-1/base.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.venework.app.venework-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)


如果我使用任何其他设备进行测试,一切正常...有任何提示吗?我没有其他选择。谢谢

最佳答案



初始屏幕图像位于错误的文件夹中。使用drawable而不是drawable-xxhdpi ...确实是一个愚蠢的问题..对于具有低分辨率显示器的设备,这没有什么区别,但是对于像三星S7这样的高分辨率显示器,则完全是另一回事。 。

10-07 18:45