question

tylocook avatar image
tylocook asked

Unity 4.2.2f and Example Scene Crash

I receiving the following error after successfully importing the GameCircle package into Unity and opening the provided example Scene. If I attempt to run this on an android device, it crashes after pressing the initialize button. Exception: JNI: Init'd AndroidJavaClass with null ptr! UnityEngine.AndroidJavaClass..ctor (IntPtr jclass) (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/Export/AndroidJavaImpl.cs:533) UnityEngine.AndroidJavaObject.get_JavaLangClass () (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/Export/AndroidJavaImpl.cs:511) UnityEngine.AndroidJavaObject.FindClass (System.String name) (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/Export/AndroidJavaImpl.cs:502) UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/Export/AndroidJavaImpl.cs:522) UnityEngine.AndroidJavaClass..ctor (System.String className) (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/ExportGenerated/Editor/AndroidJava.cs:91) AGSClient..cctor () (at Assets/Plugins/AmazonGameCirclePlugin/Source/AGSClient.cs:97) Rethrow as TypeInitializationException: An exception was thrown by the type initializer for AGSClient GameCircleManager.OnApplicationFocus (Boolean focusStatus) (at Assets/Plugins/AmazonGameCirclePlugin/Source/GameCircleManager.cs:142) Message was edited by: tylocook
10 |5000

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

tylocook avatar image
tylocook answered
I looked into this a little bit more and have found that the app crashes on this block of code. The line in bold is where it crashes. #if UNITY_ANDROID JavaObject = new AmazonJavaWrapper(); [b]using( var PluginClass = new AndroidJavaClass( PROXY_CLASS_NAME ) )[/b]{ if (PluginClass.GetRawClass() == IntPtr.Zero) { LogGameCircleWarning("No java class " + PROXY_CLASS_NAME + " present, can't use AGSClient" ); return; } JavaObject.setAndroidJavaObject(PluginClass.CallStatic ( "getInstance" )); } #endif For reference, this is the value of PROXY_CLASS_NAME private static readonly string PROXY_CLASS_NAME = "com.amazon.ags.api.unity.AmazonGamesClientProxyImpl";[b][/b][b][/b] Message was edited by: tylocook Message was edited by: tylocook
10 |5000

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

Venkat@Amazon avatar image
Venkat@Amazon answered
We have received your ContactUs and we will continue to support you in the same 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.