Project under Unity3D 5.3.4, which includes mobfox-android-unity-plugin.jar won't initialize MobFox by calling ConnectToPlugin() method as the following exception will be thrown.
AndroidJavaException: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
It happens while executing the following lines:
using (AndroidJavaClass pluginClass = new AndroidJavaClass ( "com.mobfox.unity.plugin.MobFoxPlugin" ))
{
if (pluginClass != null)
{
mobFoxPlugin = pluginClass.CallStatic<AndroidJavaObject> ( "instance" ); //this line causes exception
mobFoxPlugin.Call ( "setContext", activityContext );
}
}
Exception is thrown as soon as getting instance is called.
If we upgrade project to Unity3D 5.4.0 - everything will be OK.
Project under Unity3D 5.3.4, which includes mobfox-android-unity-plugin.jar won't initialize MobFox by calling
ConnectToPlugin()
method as the following exception will be thrown.It happens while executing the following lines:
Exception is thrown as soon as getting instance is called.
If we upgrade project to Unity3D 5.4.0 - everything will be OK.