Bug 33657 - Java.Lang.IllegalArgumentExceptionService not registered: mdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.InAppBillingServiceConnection@xxxxxxxx in Xamarin.InAppBilling
Summary: Java.Lang.IllegalArgumentExceptionService not registered: mdxxxxxxxxxxxxxxxxx...
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Staging (addons.xamstage.com)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Kevin Mullins
Depends on:
Reported: 2015-09-04 09:07 UTC by halilgoecer
Modified: 2016-12-08 13:20 UTC (History)
3 users (show)

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 for Bug 33657 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description halilgoecer 2015-09-04 09:07:29 UTC
I get the following stacktrace in Xamarin.InAppBilling for Xamarin.Android:

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00000] in <filename unknown>:0 
  at Android.Content.ContextWrapper.UnbindService (IServiceConnection conn) [0x00000] in <filename unknown>:0 
  at Xamarin.InAppBilling.InAppBillingServiceConnection.Disconnect () [0x00000] in <filename unknown>:0 
  at MyApp.AndroidPhone.SampleClass+<Sample>d__4.MoveNext () [0x00000] in <filename unknown>:0 
  --- End of managed exception stack trace ---
java.lang.IllegalArgumentException: Service not registered: mdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.InAppBillingServiceConnection@xxxxxxxx
	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:935)
	at android.app.ContextImpl.unbindService(ContextImpl.java:1990)
	at android.content.ContextWrapper.unbindService(ContextWrapper.java:541)
	at mono.java.lang.RunnableImplementor.n_run(Native Method)
	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
	at android.os.Handler.handleCallback(Handler.java:733)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:136)
	at android.app.ActivityThread.main(ActivityThread.java:5476)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
	at dalvik.system.NativeStart.main(Native Method)

I think this crash occurs when calling InAppBillingServiceConnection.Disconnect(), but the Service is null or already unregistered. Maybe you have to add a check to InAppBillingServiceConnection.Disconnect() if the service is null or unregistered.

Thank You.