Start a new topic

Unity: Exception: JNI: Init'd AndroidJavaObject with null ptr!

I have a unity project with 2 scenes, a main scene and an AR scene using wikitude. I'm exporting my project as an android module  and add it to my main android studio project using gradle as described here:

http://www.wikitude.com/external/doc/documentation/latest/unity/setupguideunity.html?_ga=2.180847841.778617711.1514885580-2100297950.1513244285#setup-guide-unity-plugin

The app builds ok on android, and the main scene launches fine as well but when I switch to the wikitude scene the app freezes and I get the error below in the android studio monitor. 

When I don't add it to my main project but just export it as an android project I can build and run it without freezing and no error.

I'm not sure what to look for and the error is not showing in which file it occurs so it's hard to pinpoint the problem. Any ideas on how to solve this?

01-02 16:36:00.546 7744-7761/e.unity3d I/Unity: Exception: JNI: Init'd AndroidJavaObject with null ptr!
                                                  at UnityEngine.AndroidJavaObject..ctor (IntPtr jobject) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject.AndroidJavaObjectDeleteLocalRef (IntPtr jobject) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject._GetStatic[AndroidJavaObject] (System.String fieldName) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject.GetStatic[AndroidJavaObject] (System.String fieldName) [0x00000] in <filename unknown>:0 
                                                  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
                                                Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
                                                  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cult
01-02 16:36:00.614 7744-7761/e.unity3d I/Unity: Exception: JNI: Init'd AndroidJavaObject with null ptr!
                                                  at UnityEngine.AndroidJavaObject..ctor (IntPtr jobject) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject.AndroidJavaObjectDeleteLocalRef (IntPtr jobject) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject._GetStatic[AndroidJavaObject] (System.String fieldName) [0x00000] in <filename unknown>:0 
                                                  at UnityEngine.AndroidJavaObject.GetStatic[AndroidJavaObject] (System.String fieldName) [0x00000] in <filename unknown>:0 
                                                  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
                                                Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
                                                  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cult

  



1 Comment

Hi, 


I apologize for the late reply. Can you please tell me which version of Unity you are using?


Best regards,

Alexandru

Login or Signup to post a comment