Bug 46434 - IncompatibleClassChangeError when trying to GetInstance in RegistrationIntentService
Summary: IncompatibleClassChangeError when trying to GetInstance in RegistrationIntent...
Status: RESOLVED FIXED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: N/A
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jon Dick
URL:
Depends on:
Blocks:
 
Reported: 2016-11-03 21:08 UTC by Hrvoje
Modified: 2017-05-17 12:45 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Hrvoje 2016-11-03 21:08:02 UTC
RegistrationIntentService (GCM) now raises exception on line:
InstanceID.GetInstance(this)

Used code as instructed on this Xamarin's page (chapter "Implement the Registration Intent Service"):
https://developer.xamarin.com/guides/android/application_fundamentals/notifications/remote_notifications_in_android/


Full error log is here:
{Java.Lang.IncompatibleClassChangeError: android.support.v4.content.ContextCompat
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at Java.Interop.JniEnvironment+StaticMethods.CallStaticObjectMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00082] in /Users/builder/data/lanes/3511/ce955cc0/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12649 
  at Android.Runtime.JNIEnv.CallStaticObjectMethod (System.IntPtr jclass, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x00000] in /Users/builder/data/lanes/3511/ce955cc0/source/monodroid/src/Mono.Android/JNIEnv.g.cs:562 
  at Android.Gms.Gcm.Iid.InstanceID.GetInstance (Android.Content.Context context) [0x00049] in <0254f7e3cd5c490491856beffc0bbf35>:0 
  at Orderion.App.Services.RegistrationIntentService.OnHandleIntent (Android.Content.Intent intent) [0x00031] in U:\OrderionSolution\Orderion.App\Orderion.App.Droid\Services\RegistrationIntentService.cs:29 
  --- End of managed Java.Lang.IncompatibleClassChangeError stack trace ---
java.lang.IncompatibleClassChangeError: android.support.v4.content.ContextCompat
	at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
	at com.google.android.gms.iid.zzd.<init>(Unknown Source)
	at com.google.android.gms.iid.zzd.<init>(Unknown Source)
	at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
	at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
	at md52180c0487cd7845311cd19716473759b.RegistrationIntentService.n_onHandleIntent(Native Method)
	at md52180c0487cd7845311cd19716473759b.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:37)
	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:146)
	at android.os.HandlerThread.run(HandlerThread.java:61)
}