[SOLVED] Game crashes when loading ad

twobrosapps

  • Posts: 40
I'm using a clean install of stencyl 3.2.0 (b7967) with admob 3.0 extension and anytime I try to load an ad, the game crashes.  I've done some testing and I can run the initialize block for full screen ads, but if I add in a block to load the fullscreen ad then it crashes.  If I use the initialize block for the banner ad at all, it crashes.  I'm running the initialize and load in when created on an initial scene before switching to my main scene.

I'm not at a place where I can get the logs right now, but I'm wondering if anyone has any pointers on what to check for.

« Last Edit: December 10, 2014, 07:26:21 pm by twobrosapps »

Abliblablobla

  • *
  • Posts: 524
That's very strange. When you have time for the logs, please post the DMS (Device Monitor System) logs. To open the DMS in Stencyl : Debug > Android > Launch Device Monitor. Then test your game (making sure the device is connected to your computer). When it crashes you should see some (or many) red lines of errors in the DMS log cat.

It would also help to know what device you have and its Android version.

Without those info, it is very difficult to understand what's going on.
.: BuruBuru :.

twobrosapps

  • Posts: 40
Below are the errors from the DMS logs.  This is running on a Samsung Note 3 with Android 4.4.  Looks like something to do with the Android SDK?  I've used this machine for developing apps using cordova/phonegap, which required me to install the SDK, so maybe that's messing with Stencyl in some way?



12-10 17:02:29.214: E/NME(15175): VERSION OpenGL ES 3.0 V@66.0 AU@  (CL@) (3), pipeline = programmable
12-10 17:02:30.104: E/NME(15175): CallHaxe 0x79a8b9f0
12-10 17:02:30.104: E/NME(15175): Using 0 args
12-10 17:02:30.144: E/dalvikvm(15175): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
12-10 17:02:30.144: E/dalvikvm(15175): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
12-10 17:02:30.144: E/GooglePlayServicesUtil(15175): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
12-10 17:02:30.154: E/AndroidRuntime(15175): FATAL EXCEPTION: main
12-10 17:02:30.154: E/AndroidRuntime(15175): Process: com.twobrosapps.santasride, PID: 15175
12-10 17:02:30.154: E/AndroidRuntime(15175): java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 6111000 but found 4323000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.common.GooglePlayServicesUtil.E(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.internal.au.a(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.internal.bh.bi(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.internal.bh.a(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.abliblablobla.AdMob.MyAdmob$1.run(MyAdmob.java:68)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at android.os.Handler.handleCallback(Handler.java:733)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at android.os.Handler.dispatchMessage(Handler.java:95)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at android.os.Looper.loop(Looper.java:157)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at android.app.ActivityThread.main(ActivityThread.java:5293)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at java.lang.reflect.Method.invokeNative(Native Method)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at java.lang.reflect.Method.invoke(Method.java:515)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
12-10 17:02:30.154: E/AndroidRuntime(15175):    at dalvik.system.NativeStart.main(Native Method)

rob1221

  • *
  • Posts: 9473
See this post about the meta data value: http://community.stencyl.com/index.php/topic,36098.msg205175.html#msg205175

Abliblablobla, do you think Admob will have to be merged with Google Services due to using the same SDK?

twobrosapps

  • Posts: 40
Thanks rob1221, fixing the metadata seems to have fixed things.  I can now load and display ads!  I still get the error about the google play services resources, but everything appears to be working.

Abliblablobla

  • *
  • Posts: 524
See this post about the meta data value: http://community.stencyl.com/index.php/topic,36098.msg205175.html#msg205175

Abliblablobla, do you think Admob will have to be merged with Google Services due to using the same SDK?

Maybe. I am also thinking about asking to Jon if we can create a simple extension that contains just the Google Play Services SDK and make it one of the default extensions. In that way every time we want to update the SDK, we will just need to update this simple extension. In addition it would allow us to create separate extensions (AdMob, Play Games, IAB and possibly G+, Analitycs, etc.) without creating one big and difficult to manage extension.
.: BuruBuru :.