cancel
Showing results for 
Search instead for 
Did you mean: 

App crash with BTP SDK for Android

dbchris
Explorer

Hi,

I'm running an Android app on BTP SDK 4.0.1 which uses Firebase Push. Right now my app randomly crashes, because it seems like it does not find Baidu PushServiceReceiver - even though I'm not using Baidu at all:

java.lang.RuntimeException: Unable to instantiate receiver com.baidu.android.pushservice.PushServiceReceiver: java.lang.ClassNotFoundException: Didn't find class "com.baidu.android.pushservice.PushServiceReceiver" on path: DexPathList[[zip file "/data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/lib/arm64, /data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4453)
	at android.app.ActivityThread.access$1500(ActivityThread.java:301)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2177)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:246)
	at android.app.ActivityThread.main(ActivityThread.java:8633)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.baidu.android.pushservice.PushServiceReceiver" on path: DexPathList[[zip file "/data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/lib/arm64, /data/app/~~KAJccdRFv759DStXGfwtpQ==/de.db.netz.mde-EjPpyhAvRYjgt9cG1BKfnQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	at android.app.AppComponentFactory.instantiateReceiver(AppComponentFactory.java:110)
	at androidx.core.app.CoreComponentFactory.instantiateReceiver(CoreComponentFactory.java:1)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4446)
	... 8 more

I'm using the "Legacy Register of Push" way to propagate my Push token to BTP Mobile Services like described in here: Legacy Register for Push. And I'm using my own implementation of FirebaseMessagingService from FCM.

I'm NOT using the way of adding a PushService to SDKInitializer.start() method.

Do I have to manually disable Baidu Push or is there some other setting I can use to prevent the app from trying to use BaiduPushService? Unfortunately, I can't reproduce the issue on a regular basis, it just seems to happen from time to time, preferably when the app was running for quite some time.

On BTP Mobile Services "Mobile Push Notification" is configured to use "Server Key" for Android. For Baidu nothing is selected.

Any suggestions on that?

View Entire Topic
former_member410600
Participant
0 Kudos

Dear Christian:

In 4.0 we do have a new feature for baidu push service. I believe you have not used baidu push feature.For not blocking your work,Would you please download baidu jar from https://channelpush.cdn.bcebos.com/sdk/Baidu-Push-SDK-Android-7.0.2.27.zip and import it into your app for now see if it works?And could you please also share your project with me? I want to do a local test see what the root cause is.Regards,Rogers