Skip to content

Upgrade from 0.9.1 to 0.9.3 requires devices to re-register with Azure Notification Hubs  #100

@jbenzshawel

Description

@jbenzshawel

Report

Environment

  • Platforms: Android
  • Android version: Android 8 and Android 10

Issues and Steps to Reproduce

  1. Register device with push notifications and version 0.9.1
  2. Send push notifications to device with registered tag
  3. Update package to 0.9.3 and make necessary changes to AndroidManifest.xml and build.gradle
  4. Run ./gradlew clean
  5. Send push notification to tag registered with version 0.9.1
  6. Application crashes

Note after re-registering with tags push notifications work as normal

Expected Behavior

App should be able to use existing tag registrations with new package

Actual Behavior

App crashes when push notification received until tags are re-registered

Android Logs

I think the error corresponding to this is this part however all logs are attached:

--------- beginning of crash
02-22 09:29:58.324 11850 11850 E AndroidRuntime: FATAL EXCEPTION: main
02-22 09:29:58.324 11850 11850 E AndroidRuntime: Process: com.XXXXXXX.mobiledev, PID: 11850
02-22 09:29:58.324 11850 11850 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate receiver com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver: java.lang.ClassNotFoundException: Didn't find class "com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver" on path: DexPathList[[zip file "/data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/base.apk"],nativeLibraryDirectories=[/data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/lib/x86, /data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3774)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.ActivityThread.access$1400(ActivityThread.java:219)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver" on path: DexPathList[[zip file "/data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/base.apk"],nativeLibraryDirectories=[/data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/lib/x86, /data/app/com.XXXXXXX.mobiledev-MtI2itLaNYncL2q8iAi2_A==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.AppComponentFactory.instantiateReceiver(AppComponentFactory.java:110)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at androidx.core.app.CoreComponentFactory.instantiateReceiver(CoreComponentFactory.java:60)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3767)
02-22 09:29:58.324 11850 11850 E AndroidRuntime: 	... 8 more
02-22 09:29:58.401  2099 12034 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
02-22 09:29:58.415  2099  3087 W ActivityTaskManager:   Force finishing activity com.XXXXXXX.mobiledev/.MainActivity
02-22 09:29:58.417  2099  3087 W InputReader: Device has associated, but no associated display id.
02-22 09:29:58.445  2099  2138 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
02-22 09:29:58.449  2099  2138 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
02-22 09:29:58.418  2099  3087 I chatty  : uid=1000(system) Binder:2099_A identical 8 lines
02-22 09:29:58.418  2099  3087 W InputReader: Device has associated, but no associated display id.
02-22 09:29:58.449  2293  2293 W GCM     : broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.XXXXXXX.mobiledev (has extras) }
02-22 09:29:58.452 11850 11850 I Process : Sending signal. PID: 11850 SIG: 9
02-22 09:29:58.511  2099  2229 W InputDispatcher: channel 'fafb745 com.XXXXXXX.mobiledev/com.XXXXXXX.mobiledev.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
02-22 09:29:58.511  2099  2229 E InputDispatcher: channel 'fafb745 com.XXXXXXX.mobiledev/com.XXXXXXX.mobiledev.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

logCat.txt

Looking at the error I think this might be related to the configuration change around removing the following in the Android Manifest without re-registering with Azure Notification Hubs:

      <receiver	
        android:name="com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver"	
        android:permission="com.google.android.c2dm.permission.SEND">	
        <intent-filter>	
          <action android:name="com.google.android.c2dm.intent.RECEIVE" />	
        </intent-filter>	
      </receiver>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions