rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

got an error while registering push notifications #131

Open igorgnedish opened 6 years ago

igorgnedish commented 6 years ago

Hi,

I have an error raised after 'CrossPushNotification.Current.Register()' method called :-(

Java.Lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/myproject-1/base.apk) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0 at Java.Interop.JniEnvironment+StaticMethods.CallStaticObjectMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue args) [0x00069] in :0 at Android.Runtime.JNIEnv.CallStaticObjectMethod (System.IntPtr jclass, System.IntPtr jmethod, Android.Runtime.JValue parms) [0x0000e] in :0 at Android.Gms.Gcm.Iid.InstanceID.GetInstance (Android.Content.Context context) [0x00049] in :0 at PushNotification.Plugin.PushNotificationRegistrationIntentService.OnHandleIntent (Android.Content.Intent intent) [0x00018] in C:\xamarin-plugins\PushNotification\PushNotification\PushNotification.Plugin.Android\PushNotificationRegistrationIntentService.cs:35 --- End of managed Java.Lang.IllegalAccessError stack trace --- java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/myproject-1/base.apk) at com.google.android.gms.iid.zzd.zzde(Unknown Source) at com.google.android.gms.iid.zzd.(Unknown Source) at com.google.android.gms.iid.zzd.(Unknown Source) at com.google.android.gms.iid.InstanceID.zza(Unknown Source) at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) at md563bb5d7cd114ceda82ec85fb57ce3637.PushNotificationRegistrationIntentService.n_onHandleIntent(Native Method) at md563bb5d7cd114ceda82ec85fb57ce3637.PushNotificationRegistrationIntentService.onHandleIntent(PushNotificationRegistrationIntentService.java:37) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)

  • Register - PushNotificationRegistationIntentService
Danielmat commented 6 years ago

I had this error for 2 days and could not resolve it, I updated all packages Xamarin.GooglePlayServices.Gcm> = 42, then updated to version 1.2.5-beta, now I can get the token, but now I have another error "INVALID_PARAMETERS" .

sirimanu commented 6 years ago

Same issue here. Any workaround to resolve it?

igorgnedish commented 6 years ago

I've switched to a firebase notifications.

Danielmat commented 6 years ago

@igorgnedish @sirimanu I've switched to a firebase notifications