目录

问题

解决


问题

项目报错:

 Caused by: java.lang.ClassNotFoundException: 
 Didn't find class "com.demo.test.MyApplication" on path: 
 DexPathList[
 [zip file "/data/app/com.demo.administrator.aa-1/base.apk"],
 nativeLibraryDirectories=
 [/data/app/com.demo.administrator.aa-1/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]

app目录下的build.gradle配置文件关于架构的信息:

android {
    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a"
            abiFilters  "arm64-v8a"
        }
    } 
}

解决

报错信息是lib64位库有问题,所以可以考虑使用armv7包。

android {
    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a"
        }
    }
}

修改后,问题解决。

这里仅提供了一种规避问题的方法,如果想了解64位库具体有什么问题,还需要深入分析,可以考虑依赖的编译库是否存在架构不统一的问题。