android9系统android studio项目改成用android.mk编译v7包--APP闪退java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader
原文件在:\vendor\..\package\DVR
打包apk在:\out\target\product\msm8953_64\system\app\DVR
编译到系统后,点击APP 打开就闪退,以下是错误 日志
01-01 00:03:06.678 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.679 4221 4241 W System.err: io.reactivex.exceptions.UndeliverableException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/DVR/DVR.apk"],nativeLibraryDirectories=[/system/app/DVR/lib/arm64, /system/app/DVR/DVR.apk!/lib/arm64-v8a, /system/lib64, /system/lib64]]] couldn't find "libmmqcar_qcar_jni.so"
01-01 00:03:06.679 4221 4241 W System.err: at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
01-01 00:03:06.679 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.679 4221 4241 W System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
01-01 00:03:06.679 4221 4241 W System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
01-01 00:03:06.679 4221 4241 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01-01 00:03:06.679 4221 4241 W System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
01-01 00:03:06.679 4221 4241 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-01 00:03:06.679 4221 4241 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-01 00:03:06.679 4221 4241 W System.err: at java.lang.Thread.run(Thread.java:764)
01-01 00:03:06.680 4221 4241 W System.err: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/DVR/DVR.apk"],nativeLibraryDirectories=[/system/app/DVR/lib/arm64, /system/app/DVR/DVR.apk!/lib/arm64-v8a, /system/lib64, /system/lib64]]] couldn't find "libmmqcar_qcar_jni.so"
01-01 00:03:06.680 4221 4241 W System.err: at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
01-01 00:03:06.680 4221 4241 W System.err: at java.lang.System.loadLibrary(System.java:1669)
01-01 00:03:06.680 4221 4241 W System.err: at com.zsj.dvr.utils.DVRRecorderUtil.LazyLoadLib(DVRRecorderUtil.java:490)
01-01 00:03:06.680 4221 4241 W System.err: at com.zsj.dvr.record.MainActivity.init(MainActivity.java:261)
01-01 00:03:06.680 4221 4241 W System.err: at com.zsj.dvr.record.MainActivity.access$300(MainActivity.java:59)
01-01 00:03:06.680 4221 4241 W System.err: at com.zsj.dvr.record.MainActivity$4.apply(MainActivity.java:172)
01-01 00:03:06.680 4221 4241 W System.err: at com.zsj.dvr.record.MainActivity$4.apply(MainActivity.java:169)
01-01 00:03:06.680 4221 4241 W System.err: at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:59)
01-01 00:03:06.680 4221 4241 W System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
01-01 00:03:06.680 4221 4241 W System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
01-01 00:03:06.680 4221 4241 W System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
01-01 00:03:06.680 4221 4241 W System.err: ... 6 more
--------- beginning of crash
01-01 00:03:06.681 4221 4241 E AndroidRuntime: FATAL EXCEPTION: RxCachedThreadScheduler-2
01-01 00:03:06.681 4221 4241 E AndroidRuntime: Process: com.zsj.dvr, PID: 4221
01-01 00:03:06.681 4221 4241 E AndroidRuntime: io.reactivex.exceptions.UndeliverableException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/DVR/DVR.apk"],nativeLibraryDirectories=[/system/app/DVR/lib/arm64, /system/app/DVR/DVR.apk!/lib/arm64-v8a, /system/lib64, /system/lib64]]] couldn't find "libmmqcar_qcar_jni.so"
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/DVR/DVR.apk"],nativeLibraryDirectories=[/system/app/DVR/lib/arm64, /system/app/DVR/DVR.apk!/lib/arm64-v8a, /system/lib64, /system/lib64]]] couldn't find "libmmqcar_qcar_jni.so"
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1669)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at com.zsj.dvr.utils.DVRRecorderUtil.LazyLoadLib(DVRRecorderUtil.java:490)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at com.zsj.dvr.record.MainActivity.init(MainActivity.java:261)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at com.zsj.dvr.record.MainActivity.access$300(MainActivity.java:59)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at com.zsj.dvr.record.MainActivity$4.apply(MainActivity.java:172)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at com.zsj.dvr.record.MainActivity$4.apply(MainActivity.java:169)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:59)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
01-01 00:03:06.681 4221 4241 E AndroidRuntime: ... 6 more
01-01 00:03:06.686 2455 2469 W ActivityManager: Force finishing activity com.zsj.dvr/.record.MainActivity
01-01 00:03:06.689 2455 2469 D ActivityTrigger: ActivityTrigger activityPauseTrigger
01-01 00:03:06.695 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.703 2455 2478 I ActivityManager: Showing crash dialog for package com.zsj.dvr u0
01-01 00:03:06.696 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.705 4221 4221 I MainActivity: onPause
01-01 00:03:06.712 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.712 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.727 608 650 D SurfaceFlinger: duplicate layer name: changing Surface(name=5982881 StatusBar)/@0x868ff81 - animation-leash to Surface(name=5982881 StatusBar)/@0x868ff81 - animation-leash#1
01-01 00:03:06.728 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-01 00:03:06.729 608 608 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
解决方案
这里的提示已非常明显了,少so库文件,我先临时手动把arm64-v8a下所有的so文件推到system/lib64下,APP已能成功打开了,正常用了
这里要注意,我这边系统是64位的