Google Analytics error

Android give me an below error.


The meta-data tag in your app’s AndroidManifest.xml does not have the right value.  Expected 8487000 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" />

Hi @Kangmin Won,

Can I see the contents of your build.settings file? Specifically, the “plugins” table…

Thanks,

Brent

plugins =

{

    [“plugin.googleAnalytics”] =

    {

        publisherId = “com.coronalabs”,

        supportedPlatforms = { iphone=true, android=true }

    },

    [‘plugin.vibrator’] = { publisherId = “com.spiralcodestudio” },

    [“plugin.google.play.services”] =

    {

        publisherId = “com.coronalabs”,

        supportedPlatforms = { iphone=true, android=true }

    },

    [“CoronaProvider.native.popup.safariView”] =

    {

        publisherId = “com.coronalabs”,

        supportedPlatforms = { iphone=true }

    },

}, 

Hi @Kangmin Won,

Can you comment out (or remove) the “plugin.google.play.services” plugin from your build.settings and try again?

[lua]

–[[[“plugin.google.play.services”] =

    {

        publisherId = “com.coronalabs”,

        supportedPlatforms = { iphone=true, android=true }

    },–]]

[/lua]

I’m also with the same issue. I comment out the “plugin.google.play.services” plugin, and I had run-time error shown in the image.

https://drive.google.com/file/d/0Bx1G5w62KWpUNl9peTktYlRSSmc/view?usp=sharing

If you are using AdMob in your app, you can’t comment out the plugin in build.settings and expect it to work. I’m pretty sure Brent was trying to have @Kangmin Won test to see if he had build.settings issues. If you wish to conduct test, you also have to comment out calls to ads.init(), ads.show() etc. in your code while you conduct the test.

Also seeing your build.settings would be helpful.

What version of Corona SDK are you using?

Rob

I’m using the version 2016.2830.

Following my Build.settings file and the full error when using the 2 plugins.

build.settings:

plugins = { -- key is the name passed to Lua's 'require()' ["plugin.google.play.services"] = { -- required publisherId = "com.coronalabs", }, ["plugin.googleAnalytics"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, osx=true, win32=true } }, },

Full error:

java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 8487000 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.zzan(Unknown Source) at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source) at com.google.android.gms.ads.internal.util.client.zza.zzU(Unknown Source) at com.google.android.gms.ads.internal.client.zze.zzb(Unknown Source) at com.google.android.gms.ads.internal.client.zzac.zzH(Unknown Source) at com.google.android.gms.ads.internal.client.zzac.zza(Unknown Source) at com.google.android.gms.ads.InterstitialAd.loadAd(Unknown Source) at CoronaProvider.ads.admob.AdMobAd$3.run(AdMobAd.java:209) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:155) at android.app.ActivityThread.main(ActivityThread.java:5689) 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:1029) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

I’m trying to find out what this error means. There is a good chance we are going to need a bug report. If I can go ahead and get you to submit one that would be great.

Please put together a sample project that demonstrates the issue. It needs to have a main.lua, config.lua and build.settings file and any assets to build and run the project. Put that in a zip file and use the Report a bug link at the top of the page.

Thanks

Rob

I submitted the bug.

Did you get the email with the CaseID?

Hi Rob.

Case 45530.

Dear Team,
have any news?

Its assigned to an Engineer but we don’t have a solution yet. It’s a complex problem to solve.

I’m getting this same error on Android (Corona 2866), but mine seems to be related to OneSignal. If I comment out the call to initialise OneSignal the problem goes away, but if I leave it in it fails.

Is this broader than GA? If I remove GA will it help?

Here’s my plugins…

plugins = { ["plugin.gameanalytics"] = { publisherId = "com.gameanalytics", }, &nbsp; &nbsp; &nbsp; &nbsp; ["plugin.OneSignal"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.onesignal", &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["plugin.advertisingId"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs" &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.native.popup.social"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs" &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["plugin.notifications"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs" &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["plugin.googleAnalytics"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { iphone=true, android=true, } &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.analytics.flurry"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { iphone=true, android=true } &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.gameNetwork.google"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { android=true } &nbsp; &nbsp; &nbsp; &nbsp; }, },

I removed Google Analytics and the problem went away.

The OneSignal SDK depends on Google Play services (GMS) but it can use either version 8487000 or 4242000. It does not include GMS itself so it relies on another plugin to include it. The GMS methods that OneSignal accesses (as well as some other plugins) requires that the follow meta-data tag to be present.

\<meta-data android:name="com.google.android.gms.version" android:value="@integer/google\_play\_services\_version" /\>

However the issue is not all plugins that include GCM include this AndroidManifest.xml entry as they should. plugin.googleAnalytics should add this manifest however there would have to be something in Corona to manage the merging of the version to use the higher value to match the Java classes themselves.

Is there any update to this? I’m also having this issue. This prevents my game from using Google Play Game Services. The odd thing is that sometimes it works and sometimes it doesn’t. It seems to be random.

The only way to completely resolve this for now is to disable the Google Analytics plugin. A better solution would be appreciated. Thanks!

Include the AdMob plugin. That will include the Google Play Services library.

Rob,

These are the plugins I’m using. 

plugins = { --[[["plugin.googleAnalytics"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, } },]] ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["plugin.gamecircle"] = { publisherId = "COM\_INNOVATIVELEISURE", supportedPlatforms = { ["android-kindle"] = true }, }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true } }, ["plugin.amazon.iap"] = { publisherId = "com.coronalabs", supportedPlatforms = { ["android-kindle"]=true }, }, },

Commenting out the Analytics plugin like I have done above makes Google Play Game Services work correctly. Are you saying I can keep Analytics if I include the Admob plugin?

Thanks,

George

I can’t say for certain, but Its worth giving it a try.

The problem is rooted in the fact that many of the Android plugins want a different version of Google Play’s library. Some plugins include it, others don’t.

I’m hoping that including it will solve your problem.

Rob