Android集成极光推送 的异常
Android集成极光推送报错,细节方面导致程序报的异常,但方便有同学之后遇到,这里做个记录
1.贴下报错信息:
D/JPush: [JPushInterface] action:init - sdkVersion:2.1.5, buildId:298
E/JPush: [JPushInterface] System.loadLibrary::jpush215java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.hy.jpush-1/
base.apk"],nativeLibraryDirectories=[/data/app/com.hy.jpush-1/lib/arm64, /vendor/
lib64, /system/lib64]]] couldn't find "libjpush215.so"
W/System.err: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList
[[zip file "/data/app/com.hy.jpush-1/base.apk"],nativeLibraryDirectories=[/data/app/
com.hy.jpush-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libjpush215.so"
07-22 17:48:42.284 13121-13121/? W/System.err: at cn.jpush.android.api.JPushInterface.init(Unknown Source)
07-22 17:48:42.304 13121-13121/? W/System.err: java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.hy.jpush-1/
base.apk"],nativeLibraryDirectories=[/data/app/com.hy.jpush-1/lib/arm64, /vendor/
lib64, /system/lib64]]] couldn't find "libjpush215.so"
...
07-22 17:48:42.304 13121-13121/? E/art: No implementation found for int
cn.jpush.android.service.PushProtocol.GetSdkVersion() (tried Java_cn_jpush_android_service_PushProtocol_GetSdkVersion and
Java_cn_jpush_android_service_PushProtocol_GetSdkVersion__)
07-22 17:48:42.304 13121-13121/? E/JPush: [JPushGlobal] Get sdk version fail![获取sdk版本失败!]
07-22 17:48:42.304 13121-13121/? W/System.err: java.lang.UnsatisfiedLinkError: No
implementation found for int cn.jpush.android.service.PushProtocol.GetSdkVersion()
(tried Java_cn_jpush_android_service_PushProtocol_GetSdkVersion and
Java_cn_jpush_android_service_PushProtocol_GetSdkVersion__)
07-22 17:48:42.304 13121-13121/? W/System.err: at
cn.jpush.android.service.PushProtocol.GetSdkVersion(Native Method)
07-22 17:48:42.304 13121-13121/? W/System.err: at cn.jpush.android.e.a(Unknown
Source)
07-22 17:48:42.304 13121-13121/? W/System.err: at cn.jpush.android.e.a(Unknown
Source)
07-22 17:48:42.304 13121-13121/? W/System.err: at
cn.jpush.android.api.JPushInterface.init(Unknown Source)
07-22 17:48:42.304 13121-13121/? E/JPush: [JPushGlobal] JPush .so file do not match
JPush .jar file in the project, Failed to init JPush
07-22 17:48:42.594 13121-13121/? D/JPush: [PushReceiver] onReceive - android.net.conn.CONNECTIVITY_CHANGE
...
2.可以从上面的报错信息看到 “找不到libjpush215.so”,程序中明明有libjpush2.15so包,莫非日志提示错了,查了极光论坛,看到有帖子上面说了此异常发生的原因,才恍然大悟。
3.该帖的url:
https://community.jiguang.cn/t/06-06-10-44-56-384-e-jpush-22543-jpushglobal-get-sdk-version-fail-sdk/4189
4.主要由于so包和jar包的版本不对应导致了该异常,那么解决的方案就很简单了,替换成一致的即可;
5.细节细节,这里就不总结咯!