本文主要是介绍GreenDao数据库结合sqlcipher时的运行时异常:java.lang.UnsatisfiedLinkError …couldn't find libsqlcipher.so,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
GreenDao数据库结合sqlcipher时的运行时异常大致的异常信息如下:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.m.c-2/base.apk"],nativeLibraryDirectories=[/data/app/com.m.c-2/lib/arm64, /data/app/com.m.c-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libsqlcipher.so"
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.m.c-2/base.apk"],nativeLibraryDirectories=[/data/app/com.m.c-2/lib/arm64, /data/app/com.m.c-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libsqlcipher.so"
处理方式:需要在build.gradle文件里加入:
ndk {
// 配置支持的SO库构架,注意这里要根据实际情况来处理
abiFilters 'armeabi', 'x86' //'armeabi-v7a', 'arm64-v8a', 'x86_64', 'mips' ,'mips64'
}
如下:
defaultConfig {applicationId "com.smallsnail.bighorn"minSdkVersion rootProject.ext.android["minSdkVersion"]targetSdkVersion rootProject.ext.android["targetSdkVersion"]versionCode rootProject.ext.android["versionCode"]versionName rootProject.ext.android["versionName"]testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"javaCompileOptions {annotationProcessorOptions {arguments = [AROUTER_MODULE_NAME: project.getName()]}}vectorDrawables.useSupportLibrary = truecompileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}ndk {// 配置支持的SO库构架,注意这里要根据实际情况来处理abiFilters 'armeabi', 'x86' //'armeabi-v7a', 'arm64-v8a', 'x86_64', 'mips' ,'mips64'}}
由于作者水平有限,语言描述及代码实现中难免有纰漏,望各位看官多提宝贵意见!
Hello , World !
感谢所有!
这篇关于GreenDao数据库结合sqlcipher时的运行时异常:java.lang.UnsatisfiedLinkError …couldn't find libsqlcipher.so的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!