Hi, we updated the GameCircle Unity3D plugin from version 1.x to 2.0. Unfortunately, now the game crashes when calling [b]AGSAchievementsClient.ShowAchievementsOverlay (); [/b] with the following log: [i]08-09 11:55:56.612: E/AndroidRuntime(16239): FATAL EXCEPTION: GLThread 1327 08-09 11:55:56.612: E/AndroidRuntime(16239): java.lang.NullPointerException 08-09 11:55:56.612: E/AndroidRuntime(16239): at com.amazon.ags.api.unity.AchievementsClientProxyImpl.showAchievementsOverlay(AchievementsClientProxyImpl.java:79) 08-09 11:55:56.612: E/AndroidRuntime(16239): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 08-09 11:55:56.612: E/AndroidRuntime(16239): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 08-09 11:55:56.612: E/AndroidRuntime(16239): at com.unity3d.player.UnityPlayer.onDrawFrame(Unknown Source) 08-09 11:55:56.612: E/AndroidRuntime(16239): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462) 08-09 11:55:56.612: E/AndroidRuntime(16239): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)[/i] Any ideas what went wrong? Thanks.
Hi Sujoy, thanks for your reply. Yes everything was initialized according to the GameCircle 2.0 Unity3D integration documentation. All additional calls are made after service ready was called back. Also, the logs seem to approve the initialization went through successfully before any other call is made. Two additional things I found out this morning: 1. The variable [i]AmazonGamesClientProxyImpl.this.agsClient[/i] inside the Unity3D GameCirlce wrapper plugin seems to be [i]null[/i] all the time. Meaning every call that is made into the GameCircle plugin (expect the initialization) throws a NullPointerException for me right now (for example requesting achievements, showing the achievements overlay, reporting achievement progress, ...) 2. Inside [i]AmazonGamesClientProxyImpl[/i] the [i]onServiceReady[/i] callback notifies Unity3D about service ready before assigning the [i]AmazonGamesClientProxyImpl.this.agsClient[/i] member variable. Calling any function inside unity when the service ready is returned might end up with a NullPointerException when accessing [i]AmazonGamesClientProxyImpl.this.agsClient[/i] due to java calls. (I am not an expert when it comes to java and unity android plugins, so this is just a guess ;) ) I hope this will help a bit investigating the problem.
This is happening to me as well. Same issues. Everything is being initialized properly and I get a response from the plugin telling me that it has been initialized, but every call after that crashes the game. When it is initialized I even get the little popup telling the user that the game has been enabled for GameCircle.
I am also getting this error in the editor: Exception: JNI: Init'd AndroidJavaClass with null ptr! UnityEngine.AndroidJavaClass..ctor (IntPtr jclass) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Export/AndroidJavaImpl.cs:533) UnityEngine.AndroidJavaObject.get_JavaLangClass () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Export/AndroidJavaImpl.cs:511) UnityEngine.AndroidJavaObject.FindClass (System.String name) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Export/AndroidJavaImpl.cs:502) UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Export/AndroidJavaImpl.cs:522) UnityEngine.AndroidJavaClass..ctor (System.String className) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/AndroidJava.cs:91) AGSClient..cctor () (at Assets/Plugins/GameCircleAndroid/AGSClient.cs:47) Rethrow as TypeInitializationException: An exception was thrown by the type initializer for AGSClient GameCircleManager.OnApplicationFocus (Boolean focusStatus) (at Assets/Plugins/GameCircleAndroid/GameCircleManager.cs:131)