GLBasic forum

Main forum => Bug Reports => Topic started by: MrPlow on 2020-Mar-07

Title: Android Dev Related Issues / Bugs
Post by: MrPlow on 2020-Mar-07
Thought it would be good to have a bug topic for the Android Stuff...

Let me kick it off ...

My app is reporting errors for some devices with Tilt Changes...not sure if related to the admob action in the Tilt but it is a the most common of the crashes to date...still low though...

Here is the offending line on SDLSurface code

Line 1903:   SDLGlbasic.TiltSensor(-x / SensorManager.GRAVITY_EARTH,y / SensorManager.GRAVITY_EARTH,event.values[2] / SensorManager.GRAVITY_EARTH); //****GLBASIC****

java.lang.NullPointerException:
  at org.libsdl.app.Interstitial.show (Interstitial.java:32)
  at org.libsdl.app.SDLGlbasic.TiltSensor (SDLGlbasic.java:762)
  at org.libsdl.app.SDLSurface.onSensorChanged (SDLActivity.java:1903)
  at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent (SystemSensorManager.java:1014)
  at android.os.MessageQueue.nativePollOnce (Native Method)
  at android.os.MessageQueue.next (MessageQueue.java:336)
  at android.os.Looper.loop (Looper.java:197)
  at android.app.ActivityThread.main (ActivityThread.java:7762)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1047)
Title: Re: Android Dev Related Issues / Bugs
Post by: spacefractal on 2020-Mar-08
Me guess: You have property tried to show a ad before the ads even have been init (which sometimes can take a while). this can happens if you launch a ads too early, etc on launch.

This why im actuelly diddent show a ad in startup in Genius Greedy Mouse, but first do that much later when you leave a level.

Howover, just add a nullpointercheck to avoid it in public void show(int status), and then its fixed. etc mInterstitialAd object does first create after a init has been done.... which is done asyncon.

PS. Fixed in next release. its does now first try to show the ads after the init have been property done and a load has been loaded. If a ads has newer been loaded, then its will fails gracefull with no ads to been show (and you can checkout its status).