java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.y

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ywl5320.mymusic-tDRmsuOs4iJpkO2qE2A1Lg==/base.apk"],nativeLibraryDirectories=[/data/app/com.ywl5320.mymusic-tDRmsuOs4iJpkO2qE2A1Lg==/lib/arm64, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64]]] couldn't find "libnative-lib.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
        at java.lang.System.loadLibrary(System.java:1668)
        at com.ywl5320.myplayer.Demo.<clinit>(Demo.java:10)
        at com.ywl5320.mymusic.MainActivity.onCreate(MainActivity.java:21)
        at android.app.Activity.performCreate(Activity.java:8086)
        at android.app.Activity.performCreate(Activity.java:8074)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3746)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3952)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:213)
        at android.app.ActivityThread.main(ActivityThread.java:8169)
        at java.lang.reflect.Method.invoke(Native Method)

总结:这个坑算是google兼容不好出现的
1: gradle版本为3.4的时候,无论你在build.grandle是否添加  ndk {    abiFilters  'arm64-v8a'}armv8的支持,无论你生成的apk中lib文件夹是否有arm64文件系夹,只要手机是64位的arm,系统都会去找那个文件夹中的so文件.

2:gradle版本为2.14.1的时候,你没有加 ndk {    abiFilters  'arm64-v8a'}armv8的支持,在遇到64位arm手机时,系统不会去apk中arm64文件夹找对应的so文件,而会去armeabi文件夹找对应的so
 

我把gradle版本直接改小了就成,有条件编译出相应版本

 

发布了67 篇原创文章 · 获赞 34 · 访问量 6万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览