BergQuester avatar image
BergQuester asked

Crash when running with Xamarin Kindle IAP

Following the steps at

Getting this crash. What gives?

System.NotSupportedException: Could not activate JNI Handle 0x7fff3b91368c (key_handle 0x1cc5b91b) of Java type 'md58441721984586c4571cb9a14cde11b83/MainActivity' as managed type 'MyApp.Droid.MainActivity'. ---> System.TypeInitializationException: The type initializer for 'Builder' threw an exception. ---> Java.Lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.client.myApp-1/base.apk"],nativeLibraryDirectories=[/data/app/org.client.myApp-1/lib/x86_64, /vendor/lib64, /system/lib64]]] couldn't find ""
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <183b200ee49746d48fc781625979428e>:0
  at Java.Interop.JniEnvironment+StaticMethods.CallStaticVoidMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <50812bf827614c0faffacac58772b4fa>:0
  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeVoidMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00018] in <50812bf827614c0faffacac58772b4fa>:0
  at Java.Lang.JavaSystem.LoadLibrary (System.String libname) [0x00029] in <71828dd8fb5f4508815e23d6996c45c2>:0
  at () [0x00016] in <909e8c2781f24da69e9ca12b0195ac21>:0
  at () [0x00000] in <909e8c2781f24da69e9ca12b0195ac21>:0
  at java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.client.myApp-1/base.apk"],nativeLibraryDirectories=[/data/app/org.client.myApp-1/lib/x86_64, /vendor/lib64, /system/lib64]]] couldn't find "
  at at java.lang.Runtime.loadLibrary(
  at at java.lang.System.loadLibrary(
  at at Method)
  at at
  at at md58441721984586c4571cb9a14cde11b83.MainActivity.<init>(
  at at java.lang.reflect.Constructor.newInstance(Native Method)
  at at java.lang.Class.newInstance(
  at at
  at at
  at at
  at at$800(
  at at$H.handleMessage(
  at at android.os.Handler.dispatchMessage(
  at at android.os.Looper.loop(
  at at
  at at java.lang.reflect.Method.invoke(Native Method)
  at at java.lang.reflect.Method.invoke(
  at at$
  at at
  --- End of inner exception stack trace ---
  at at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
  at () [0x00001] in <909e8c2781f24da69e9ca12b0195ac21>:0
  at MyApp.Droid.AmazonIAPController..ctor () [0x00008] in /Volumes/HomeSSD/danielbergquist/src/app/MyApp/Droid/AmazonIAPController.cs:16
  at MyApp.Droid.MainActivity..ctor () [0x0000c] in /Volumes/HomeSSD/danielbergquist/src/app/MyApp/Droid/MainActivity.cs:20
  at at (wrapper dynamic-method) System.Object:891d7f60-510b-4b30-9cef-1fa96e87a12f (intptr,object[])
  at Java.Interop.TypeManager.n_Activate (System.IntPtr jnienv, System.IntPtr jclass, System.IntPtr typename_ptr, System.IntPtr signature_ptr, System.IntPtr jobject, System.IntPtr parameters_ptr) [0x000de] in <71828dd8fb5f4508815e23d6996c45c2>:0
  --- End of inner exception stack trace ---

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi BergQuester,

Thanks for posting! The Xamarin plugin hasn't been modified for some time, so this exception is not because of some changes to it. What Android SDK version are you building this against? If fairly old, can you update to the latest? Do you have the latest support libraries? Are you accessing any properties in a method where those values have not been set yet (for example, trying to read Height or Width in the constructor, instead of OnDraw(), etc). Are you calling a method on an object that's null? Can you set breakpoints and try to debug your project step by step? Specifically put breakpoints on your class constructors and go from there. If you are sure none of those apply, have you tried to clean your project, or start a new one from scratch?

For reference, see also this SO thread:

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.