App with AppCenter crashes when offline (android.content.ContextWrapper.getSystemService) ....

boris_dvboris_dv ✭✭USMember ✭✭
edited August 2018 in Xamarin.Forms

Hi, i integrated AppCenters notifications, crashes and analytics into my app
https://docs.microsoft.com/en-us/appcenter/sdk/push/xamarin-forms ... Registered receiver in AndroidManifest :
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" /> <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="${applicationId}" /> </intent-filter> </receiver>
and everything is working fine ... Push notifications are working .. (most of the time)
i can see all the crashes and errors ...

BUT ... if i run the app offline (on most phones this happens only for the first time running) .. it crashes

Unhandled Exception from source=AppDomain 08-16 15:37:26.442 E/AppCenterCrashes( 8201): Java.Lang.RuntimeException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference 08-16 15:37:26.442 E/AppCenterCrashes( 8201): --- End of managed Java.Lang.RuntimeException stack trace --- 08-16 15:37:26.442 E/AppCenterCrashes( 8201): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at android.content.ContextWrapper.getSystemService(ContextWrapper.java:714) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at com.google.firebase.iid.FirebaseInstanceIdService.zzen(Unknown Source:2) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source:5) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source:80) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at com.google.firebase.iid.FirebaseInstanceIdService.handleIntent(Unknown Source:158) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at com.google.firebase.iid.zzc.run(Unknown Source:4) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 08-16 15:37:26.442 E/AppCenterCrashes( 8201): at java.lang.Thread.run(Thread.java:784)

But one Galaxy Core Prime Android 5.1.1 .. it crashes even if its connected ...

Any help or ideas ?

Thanks

Posts

  • leticiaborgesleticiaborges Member

    Hi,

    I'm having the same problem, and I'm also using Analytics, Crashes and Push notifications.
    The error only happens the first time I run the app offline:

    08-26 15:09:50.437 E/AndroidRuntime(22626): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at android.content.ContextWrapper.getSystemService(ContextWrapper.java:719)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at com.google.firebase.iid.FirebaseInstanceIdService.zzen(Unknown Source)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at com.google.firebase.iid.FirebaseInstanceIdService.handleIntent(Unknown Source)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at com.google.firebase.iid.zzc.run(Unknown Source)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    08-26 15:09:50.437 E/AndroidRuntime(22626):     at java.lang.Thread.run(Thread.java:762)
    

    Can anyone help us?

Sign In or Register to comment.