如何在外部添加.so文件
how to add .so file externally
java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/base.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_dependencies_apk.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_slice_0_apk.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "liblibAndroidImageFilter.so.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at cn.Ragnarok.LightFilter.<clinit>(LightFilter.java:8)
at cn.Ragnarok.LightFilter.changeToLight(Unknown Source:0)
at cn.Ragnarok.BitmapFilter.changeStyle(BitmapFilter.java:75)
at com.example.c.phototopencilsketcheditor.activities.FilterFrameActivity.generarListaEffectosFree(FilterFrameActivity.java:533)
at com.example.c.phototopencilsketcheditor.activities.FilterFrameActivity.onCreate(FilterFrameActivity.java:226)
at android.app.Activity.performCreate(Activity.java:6998)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
在 android Studio 项目的 main 中创建 jniLibs 文件夹,并将所有 .so 文件放入其中。您还可以将此行整合到 build.gradle.
文件夹结构看起来像、
|--应用程序:
|--|--来源:
|--|--|--主要
|--|--|--|--jniLibs
|--|--|--|--|--armeabi
|--|--|--|--|--|--.so 文件
|--|--|--|--|--x86
|--|--|--|--|--|--.so 文件
java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/base.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_dependencies_apk.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_slice_0_apk.apk",
zip file "/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.c.phototopencilsketcheditor-ObszC6NtyRqQ_yniuaI2SA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "liblibAndroidImageFilter.so.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at cn.Ragnarok.LightFilter.<clinit>(LightFilter.java:8)
at cn.Ragnarok.LightFilter.changeToLight(Unknown Source:0)
at cn.Ragnarok.BitmapFilter.changeStyle(BitmapFilter.java:75)
at com.example.c.phototopencilsketcheditor.activities.FilterFrameActivity.generarListaEffectosFree(FilterFrameActivity.java:533)
at com.example.c.phototopencilsketcheditor.activities.FilterFrameActivity.onCreate(FilterFrameActivity.java:226)
at android.app.Activity.performCreate(Activity.java:6998)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
在 android Studio 项目的 main 中创建 jniLibs 文件夹,并将所有 .so 文件放入其中。您还可以将此行整合到 build.gradle.
文件夹结构看起来像、
|--应用程序:
|--|--来源:
|--|--|--主要
|--|--|--|--jniLibs
|--|--|--|--|--armeabi
|--|--|--|--|--|--.so 文件
|--|--|--|--|--x86
|--|--|--|--|--|--.so 文件