我的Android应用程序中遇到了奇怪的问题。它总是给我一个错误
java.lang.RuntimeException:无法实例化应用程序 io.hitanime.app.App:java.lang.ClassNotFoundException:找不到 路径上的类“ io.hitanime.app.App”:DexPathList [[zip文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/base.apk”,邮政编码 文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_dependencies_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_resources_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_0_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_1_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_2_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_3_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_4_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_5_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_6_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_7_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_8_apk.apk”, 压缩文件 “ /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/lib/arm64, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/base.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==//split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==//split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==//split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/io.hitanime.app-957U27HR57arXVvYGSCFSQ==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, / system / lib64,/ system / vendor / lib64]]
我已在我的应用程序中启用了multidex,并试图从最近两天开始解决它,但是无法解决。
我尝试过 1)清理项目并重建 2)使缓存无效并重新启动 3)禁用Multidex
让我知道是否有人可以帮助我解决难题。 谢谢
答案 0 :(得分:0)
我知道这是一个老问题,但再次遇到此问题的人请尝试将以下几行添加到您的 app/build.gradle
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
答案 1 :(得分:-1)
在这个愚蠢的问题上,我花了很多时间,但终于解决了:
在创建新项目时->包名称导致出现此愚蠢的dex问题,无论安装了哪种部署,都一定不能在运行时找到主要活动。 Android Studio不喜欢我的一些常用软件包名称,我完全感到困惑。.我认为这是一个很大的错误哈哈
给出以下新的项目参数:
名称:NotificationApp,程序包名称:com.stores.business.notificationapp,保存位置:/ home / me / AndroidStudioProjects / NotificationApp
我将收到以下错误:java.lang.RuntimeException:无法实例化活动ComponentInfo {com.stores.business.notificationapp / com.stores.business.notificationapp.MainActivity}:java.lang.ClassNotFoundException:没有在路径上找到类“ com.stores.business.notificationapp.MainActivity”:DexPathList [[zip文件“ /data/app/com.stores.business.notificationapp-2/base.apk"],nativeLibraryDirectories=[/data/app /com.cvs.stores.myapplication-2/lib/arm64、/vendor/lib64、/system/lib64]],位于android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
我的解决方案我通过将软件包名称更改为:com.notificationapp来解决它,然后选择File-> invalidate caches / Restart ..希望这可以帮助其他人哈哈