[coco2dx] Showing a banner ad with AdMob.. App crashes after launch

  • stackmann0
    Likes 0

    Problem Description

    Hello Sonar,

    I’m using cocos2dx v 3.9 with the cocos helper; I’m trying to get basic banner ads to show up..

    I followed the steps in the video tutorials.. but when I compile and launch the game, it crashes

     

    12-02 22:52:33.689: E/AndroidRuntime(13169): FATAL EXCEPTION: main
    12-02 22:52:33.689: E/AndroidRuntime(13169): java.lang.NoClassDefFoundError: android.support.v4.util.SimpleArrayMap
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.zzb.<init>(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.zzc.<init>(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.zzf.<init>(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.client.zze.zza(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.client.zzz.zzdb(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.client.zzz.zzda(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.internal.client.zzz.zza(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at sonar.systems.frameworks.AdMob.AdMobAds$3.run(AdMobAds.java:227)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at android.os.Handler.handleCallback(Handler.java:615)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at android.os.Handler.dispatchMessage(Handler.java:92)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at android.os.Looper.loop(Looper.java:137)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at java.lang.reflect.Method.invokeNative(Native Method)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at java.lang.reflect.Method.invoke(Method.java:511)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
    12-02 22:52:33.689: E/AndroidRuntime(13169): 	at dalvik.system.NativeStart.main(Native Method)
    

    Another thing is that I’m not setting the test device id for Admob..how do I get that?

    If you have any idea what’s causing this..help me.

  • stackmann0
    Likes 0

    Logcat is saying also : 

    GooglePlayServices not available due to error 2
    

    I searched that, and found that the problem arises from not having google play services installed in the devices… Doesn’t CocosHelper include any exception management for cases like this?

Login to reply