IndoorAtlas / unity-plugin

IndoorAtlas Unity plugin
Apache License 2.0
42 stars 13 forks source link

[Unity] IABehavious.cs Error on Play NullReferenceException #10

Closed tarakinsuide closed 6 years ago

tarakinsuide commented 6 years ago

Hi,

I'm new to IA and Unity development. I'm getting this error while I attach my IABehaviour.cs script to the GameObject of my choice. I'm using Mapbox along with IA to develop an app.

On attaching and playing, I'm getting the error code given below which I didn't understand. Kindly help me in understanding my mistakes.

Exception: JNI: Init'd AndroidJavaClass with null ptr!
UnityEngine.AndroidJavaClass..ctor (IntPtr jclass) (at C:/buildslave/unity/build/Runtime/Export/AndroidJavaImpl.cs:622)
UnityEngine.AndroidJavaObject.get_JavaLangClass () (at C:/buildslave/unity/build/Runtime/Export/AndroidJavaImpl.cs:600)
UnityEngine.AndroidJavaObject.FindClass (System.String name) (at C:/buildslave/unity/build/Runtime/Export/AndroidJavaImpl.cs:591)
UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) (at C:/buildslave/unity/build/Runtime/Export/AndroidJavaImpl.cs:611)
UnityEngine.AndroidJavaClass..ctor (System.String className) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/AndroidJavaBindings.gen.cs:92)
IaBehavior.Start () (at Assets/Plugins/IaBehavior.cs:25)

After I stop my app in Unity, it gives the below error code. So, which object am I supposed to set with the OnDestroy function?

NullReferenceException: Object reference not set to an instance of an object
IaBehavior.OnDestroy () (at Assets/Plugins/IaBehavior.cs:42)
handrianj commented 6 years ago

IA/Unity developer here too! It looks like the plugin will not work in the Editor, you need to build and run the app on an android device!