rdelrosario / xamarin-plugins

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

When I call CrossPushNotification.Current.Register I get a System.TypeLoadException #95

Closed jplanders closed 4 years ago

jplanders commented 7 years ago

Everything was working fine when using 1.2.2. Then I updated all the packages and since then I've been getting this System.TypeLoadException (Could not resolve type with token 01000059) when CrossPushNotification.Current.Register() is executed.

I've tried going back to 1.2.2 but the same thing is still happening...

Mrnikbobjeff commented 7 years ago

I second this, I updated my packages as well and the same error occured for me! Did you manage to resolve this error?

rhishikeshj commented 7 years ago

I third this ! I am also getting this error. System.TypeLoadException: Could not resolve type with token 0100005a at Android.App.IntentService.n_OnHandleIntent_Landroid_contentIntent (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_intent) [0x00011] in /Users/builder/data/lanes/4468/b16fb820/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.App.IntentService.cs:119 at at (wrapper dynamic-method) System.Object:8af4103f-e586-41bf-be4a-dc2579d006f0 (intptr,intptr,intptr) With the typename as : Android.Gms.Gcm.Iid.InstanceID

Any help here ?

EDIT : Additional information Simple test app with Push notification plugin seems to work. The versions of GooglePlayServices.Base and GooglePlayServices.Gcm seem to matter here. with version 2.5.0.0 everything works well but these are really old versions. The versions in my app are 42.x and if I keep Gcm to 25.0.0 and upgrade others, I get a compilation error saying com./Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: java.lang.IllegalArgumentException: already added : Lcom/google/android/gms/iid/MessengerCompat; (Pusher.Droid)

If I upgrade the Gcm nuget to version 42.x then the TypeLoadException occurs.

@rdelrosario Can you please help us out ? This seems to be a blocker issue for using this plugin.

rhishikeshj commented 7 years ago

@rdelrosario Tried to fix this here : https://github.com/rdelrosario/xamarin-plugins/pull/118

jplanders commented 7 years ago

@Mrnikbobjeff I ended up rolling back using Time Machine. Just not going to update this package unless I have a good backup first.

rdelrosario commented 7 years ago

Try https://www.nuget.org/packages/Xam.Plugin.PushNotification/1.2.5-beta

jordisnake commented 7 years ago

Great, with 1.2.5-beta works now! Error is gone! Thanks!!

pierretanguay commented 6 years ago

Works for me too @jordisnake. You are the true hero.