接入JPush过程中,产生崩溃


(HelloWorld!) #1

在我的工程里面引入了最新的华为PushSDK后,极光SDK报错崩溃。
测试手机:华为荣耀8

求解。

异常栈如下:

09-21 16:02:30.175 D/AndroidRuntime(30354): Shutting down VM
09-21 16:02:30.201 E/AndroidRuntime(30354): FATAL EXCEPTION: main
09-21 16:02:30.201 E/AndroidRuntime(30354): Process: com.dingwentao.test, PID: 30354
09-21 16:02:30.201 E/AndroidRuntime(30354): java.lang.NoClassDefFoundError: Failed resolution of: Lcn/jpush/android/c/a;
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.c.b.<init>(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.c.g.g(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.c.g.h(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.c.g.a(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.service.ServiceInterface.a(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at cn.jpush.android.api.JPushInterface.init(SourceFile)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at com.example.jpushdemo.ExampleApplication.onCreate(ExampleApplication.java:20)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1028)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5666)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.app.ActivityThread.-wrap2(ActivityThread.java)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.os.Handler.dispatchMessage(Handler.java:105)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.os.Looper.loop(Looper.java:156)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at android.app.ActivityThread.main(ActivityThread.java:6531)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.reflect.Method.invoke(Native Method)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
09-21 16:02:30.201 E/AndroidRuntime(30354): Caused by: java.lang.ClassNotFoundException: cn.jpush.android.c.a
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.VMClassLoader.findLoadedClass(Native Method)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	... 17 more
09-21 16:02:30.201 E/AndroidRuntime(30354): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/huawei/hms/api/HuaweiApiAvailability$OnUpdateListener;
09-21 16:02:30.201 E/AndroidRuntime(30354): 	... 17 more
09-21 16:02:30.201 E/AndroidRuntime(30354): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.huawei.hms.api.HuaweiApiAvailability$OnUpdateListener" on path: DexPathList[[zip file "/data/app/com.dingwentao.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dingwentao.test-1/lib/arm64, /system/fake-libs64, /data/app/com.dingwentao.test-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-21 16:02:30.201 E/AndroidRuntime(30354): 	... 17 more
09-21 16:02:30.264 D/AndroidRuntime(30381): Shutting down VM
09-21 16:02:30.288 E/AndroidRuntime(30381): FATAL EXCEPTION: main
09-21 16:02:30.288 E/AndroidRuntime(30381): Process: com.dingwentao.test:mult, PID: 30381
09-21 16:02:30.288 E/AndroidRuntime(30381): java.lang.NoClassDefFoundError: Failed resolution of: Lcn/jpush/android/c/a;
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.c.b.<init>(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.c.g.g(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.c.g.h(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.c.g.a(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.service.ServiceInterface.a(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at cn.jpush.android.api.JPushInterface.init(SourceFile)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at com.example.jpushdemo.ExampleApplication.onCreate(ExampleApplication.java:20)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1028)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5666)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.app.ActivityThread.-wrap2(ActivityThread.java)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.os.Handler.dispatchMessage(Handler.java:105)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.os.Looper.loop(Looper.java:156)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at android.app.ActivityThread.main(ActivityThread.java:6531)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.reflect.Method.invoke(Native Method)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
09-21 16:02:30.288 E/AndroidRuntime(30381): Caused by: java.lang.ClassNotFoundException: cn.jpush.android.c.a
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.VMClassLoader.findLoadedClass(Native Method)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	... 17 more
09-21 16:02:30.288 E/AndroidRuntime(30381): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/huawei/hms/api/HuaweiApiAvailability$OnUpdateListener;
09-21 16:02:30.288 E/AndroidRuntime(30381): 	... 17 more
09-21 16:02:30.288 E/AndroidRuntime(30381): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.huawei.hms.api.HuaweiApiAvailability$OnUpdateListener" on path: DexPathList[[zip file "/data/app/com.dingwentao.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dingwentao.test-1/lib/arm64, /system/fake-libs64, /data/app/com.dingwentao.test-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-21 16:02:30.288 E/AndroidRuntime(30381): 	... 17 more

#2

1、使用的极光的SDK是多少

2、先参考这个可能相似的冲突问题:

3、


(HelloWorld!) #3

使用的SDK是从管理页面生成的DEMO中取出来的,版本号是:jcore-android-1.1.6 和 jpush-android-3.0.8


(HelloWorld!) #4

我看了一下,是因为cn.jpush.android.c.a这个class继承自HuaweiApiAvailability.OnUpdateListener这个接口,而最新的华为PushSDK中HuaweiApiAvailability类是没有OnUpdateListener这个接口的。所以在虚拟机生成cn.jpush.android.c.a层面就直接报错了。我个人猜测是因为极光推送依赖了老版本的华为PushSDK,但是现在华为官网已经不提供老版本的SDK下载了。


(HelloWorld!) #5

我猜测应该就是版本兼容问题,但是我们也需要接入华为PushSDK,现在你们与华为最新的PushSDK不兼容了,怎么处理?


#6

稍等一下,我反馈上去分析一下什么情况。

你用的华为push SDK的版本号是多少?


(HelloWorld!) #7

华为PushSDK:HMSSdkPush_2.5.2.300.jar


#8

经确认:

该问题已在3.0.9版本处理,但暂未发布,你等我们这边发布了再更新敖最新的华为push SDK吧。


(HelloWorld!) #9

预期啥时候发布?我们也得排期。。。


#10

大约下周可以发布。


#11

Android SDK 3.0.9已发布
https://docs.jiguang.cn/jpush/updates/#jpush-android-sdk-v309