AdMob latest plug-in (part of pro bundle) -

Hi,

I need your help. I’m trying to update my game with the new version of adMob plug-in.

Google play game services is included in the plug-in list.

I get the following crash error on my android test device (Xiaomi Redmi  note 2, Android 5.0.2):

java.lang.IllegalStateException: The meta-data tag in your app’s AndroidManifest.xml does not have the right value.  Expected 9683000 but found 4242000.  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" />
at com.google.android.gms.common.zze.zzbt(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.ads.internal.util.client.zza.zzas(Unknown Source)
at com.google.android.gms.ads.internal.client.zzl.zza(Unknown Source)
at com.google.android.gms.ads.internal.client.zzl.zzl(Unknown Source)
at com.google.android.gms.ads.internal.client.zzag.zza(Unknown Source)
at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
at plugin.admob.LuaLoader$Init$1.run(LuaLoader.java:528)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5546)
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:967)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

I have the following plug-ins defined:

["plugin.advertisingId"] = { publisherId = "com.coronalabs" }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.analytics.flurry"] = { publisherId = "com.coronalabs", }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", },--required for several ad plug-ins ["plugin.admob"] = { publisherId = "com.coronalabs", },--the new admob plug-in ["plugin.fbAudienceNetwork"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true },}, ["plugin.adbuddiz"] = { publisherId = "com.adbuddiz",}, ["plugin.applovin"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true },}, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, },

You should remove plugin.google.play.services. That is the old AdMob plugin.

its required for some of the new plug-ins I intend to add (such as ad colony, chartboost). Or is there a new version for it?

No it’s not required for Chartboost or AdColony.

Are you sure? It says so in the project settings:

https://docs.coronalabs.com/plugin/chartboost/index.html

https://docs.coronalabs.com/plugin/adcolony/index.html

Yes, I’m sure :slight_smile:

The documentation needs to be updated since we have the new Android dependency system in place.

I’ll get somebody to look at that. Sorry for the inconvenience.

Thanks :slight_smile: Will check that.

Seems I’m still getting that error after removing plugin.google.play.services.

I’ve tracked the culprit to [“CoronaProvider.gameNetwork.google”]. It’s including the old Google Play Services jar which is causing the conflict. I’ll need to talk to the guys to see what can be done.

Thanks, I’ve been tearing my hair out trying to find a workaround. I need a quick update to fix a huge bug that started since the transition to 2017 in my app.

Is there a way to use the old admob plug-in (perhaps with some old build)? I’ve tried 3007 but it still causes this issue. Perhaps I should go further back.

To use the old AdMob plugin you’ll need to remove ‘plugin.admob’. 

Also, I think you should be good to go if you use a Corona build < 3005.

Went back to build 2987 which seems OK with the old admob v2 plug-in.

ingemar, thanks a lot for your quick response to my issue! It really helps.

@rune7

Are you using [“CoronaProvider.gameNetwork.google”] only because of Flurry Analytics?

Afraid not. We have leader boards.

Ok. No problem. Just wanted to know so I can give the proper advice.

The thing is that all CoronaProvider plugins are deprecated and are not updated anymore since they have replacements.

CoronaProvider.gameNetwork.google is replaced with plugin.gpgs and is fully backwards compatible so it should just be a matter of changing the plugin specification in build.settings, and the ‘require’ statement in your Lua files.

CoronaProvider.analytics.flurry is replaced with plugin.flurry.analytics. The logEvent() statements are fully backwards compatible. You’ll only need to change one line for init() as it accepts a listener now.

By doing that you should be “future proof” as these plugins are maintained. Also the new plugins have additional functionality should you decide to expand your app to use them.

OK, Thanks. I’ll switch to these new plug-ins and test the new Admob version

You should remove plugin.google.play.services. That is the old AdMob plugin.

its required for some of the new plug-ins I intend to add (such as ad colony, chartboost). Or is there a new version for it?

No it’s not required for Chartboost or AdColony.

Are you sure? It says so in the project settings:

https://docs.coronalabs.com/plugin/chartboost/index.html

https://docs.coronalabs.com/plugin/adcolony/index.html