Hi i am getting NullPointerException in my Unity ads init method.
Behaviour i saw.
- Using unity ads with one id it works fine. Never Gives this exception.
- When Used two id for Unity ads i start getting this exception example,
Both scripts are in my different game objects.
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize (1001);
} else {
Debug.Log(“Platform not supported”);
}
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize (5000);
} else {
Debug.Log(“Platform not supported”);
}
I am trying to use two different ID in my Game as some times ads are finished for the user. to see.
Is it possible to use two different ID in one Unity Game
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 4.5.0f6
Device model : motorola XT1033
Device fingerprint: motorola/falcon_asia_ds/falcon_umtsds:5.0.2/LXB22.46-28/30:user/release-keys
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.lang.String.length()’ on a null object reference
at com.unity3d.ads.android.UnityAds.init(UnityAds.java:667)
at com.unity3d.ads.android.unity3d.UnityAdsUnityWrapper$1.run(UnityAdsUnityWrapper.java:70)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Please Help
Thanks