Play-games-plugin-for-unity: Crash after “Application ID ( 232323232323) must be a numeric value.”

Created on 9 Nov 2017  ·  46Comments  ·  Source: playgameservices/play-games-plugin-for-unity

When I export to Gradle project and build APK in Android Studio, I get this error in run time and then application crashes:

E/ValidateServiceOp(7463): Application ID ( 232323232323) must be a numeric value. Please verify that your manifest refers to the correct project ID.
D/AndroidRuntime(8305): Shutting down VM
V/AlarmManager(2657): waitForAlarm result :8
E/AndroidRuntime(8305): Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
E/AndroidRuntime(8305):     at com.google.android.gms.common.internal.zze$zza.zzc(Unknown Source)
E/AndroidRuntime(8305):     at com.google.android.gms.common.internal.zze$zza.zzv(Unknown Source)
E/AndroidRuntime(8305):     at com.google.android.gms.common.internal.zze$zze.zzauc(Unknown Source)
E/AndroidRuntime(8305):     at com.google.android.gms.common.internal.zze$zzd.handleMessage(Unknown Source)
E/AndroidRuntime(8305):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(8305):     at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime(8305):     at android.app.ActivityThread.main(ActivityThread.java:6917)
E/AndroidRuntime(8305):     at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(8305):     at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(8305):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
E/AndroidRuntime(8305):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Looks like the problem is in leading space in app id. But this space in AndroidManifest is intentionally added via template XML:

<!-- the space in these forces it to be interpreted as a string vs. int -->
<meta-data android:name="com.google.android.gms.games.APP_ID"
    android:value="\ 232323232323" />

This does not happen when I build via Gradle directly without exporting; or if I use internal legacy build system.

Plugin: 0.9.36, Unity: 2017.2.0f2

Most helpful comment

replace "\ " with "\u003

before:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 232323232323" />
after:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003232323232323" />

All 46 comments

I'm having the same issue, did you manage to solve it?

replace "\ " with "\u003

before:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 232323232323" />
after:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003232323232323" />

Thanks @khaledElshimy, your workaround helped in my project. 👍

Thank you @khaledElshimy it worked for me too 👍 🎉 When I updated the Unity version to 2018.2, this bug occurred. if there are anybody having the same issue, you should find the AndroidManifest.xml in your project and do what @khaledElshimy says to do 😄

Yeah, updating to Unity 2018.2 was the trigger for us as well. The other development branch which uses Unity 2018.1 is still unaffected.

@hazarartuner Your solution worked for me as well. However, which "AndroidManifest.xml" file needed to be changed exactly? I found a lot of those "AndroidManifest.xml" files in my project. I changed one or two and it didn't work. Then, I finally searched and changed every single one I could find and it worked.

@exzizt , i think it's the GooglePlayGame AndroidManifest.xml, which is in "Assets/GooglePlayGames/Plugins/Android/GooglePlayGamesManifest.plugin/" folder


I did not work Unity 2018.2.0f2 (64-bit) plugin 0.9.50

The AndroidManifest.xml file is recreated on build, so why would changing the value in that file make any difference? i tried this anyway and it didn't work for me, the file got overwritten when I built again for android.

You can update the template file that generates the manifest.

Assets\GooglePlayGames\Editor\template-AndroidManifest.txt

I just tried updating the template file and still got the same error.

You can export android studio project with gradle, then you will find
googleplaygames folder where androidmanifest.xml exist.

On Mon, Aug 6, 2018 at 5:34 AM alphadogware notifications@github.com
wrote:

I just tried updating the template file and still got the same error.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/playgameservices/play-games-plugin-for-unity/issues/2013#issuecomment-410692622,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEcIJhcn7fpTw6uXdYw8UhpRLe_GTXR1ks5uODfegaJpZM4QX_bz
.

Just so I get this straight, you are saying that each time I build for android I'm going to have to build, manually make the change, then pull up the project in android studio and rebuild an apk?

replace "\ " with "\u003

before:

after:

Unity 2018.2.0f2 (64-bit) Mac - GooglePlayGamesPlugin-0.9.50
Yes it worked, you saved my life

I changed both the template file, and the generated AndroidManifest.xml. The error immediately disappeared. I am building the .apk directly from Unity / gradle (not exporting to Android Studio).

I change the file GooglePlayGamesEditor\template-AndroidManifest.txt

from

    <meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="\ __APP_ID__" />

to

    <meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="\u003__APP_ID__" />

No effect no the AndroidManifest.xml that is generated each time I build from Unity that is located in /Temp/gradleOut/build/intermediates/manifests/full/release.

I am working on a Mac, so ChristianFellefsen, please tell me which template file you edited.

Also, I have searched for APP_ID and manifest in my project folder and editing any of those files has no effect on the AndroidManifest.xml that is generated.

@alphadogware, make changes only in GooglePlayGamesEditor\template-AndroidManifest.txt. Than regenerate manifest at Window->GooglePlayGames->Setup->AndroidSetup->Setup.

the project has two andriodmanifest.xml,you must modify the anther one

| |
龚阳辉
邮箱:[email protected]
|

签名由 网易邮箱大师 定制

On 08/13/2018 20:42, EvgenyMelnikov wrote:

@alphadogware, make changes only in GooglePlayGamesEditor\template-AndroidManifest.txt. Than regenerate manifest at Window->GooglePlayGames->Setup->AndroidSetup->Setup.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

HOLY CRAP!!! I fixed it!

Put the u300 -before- the slash, not after it.

    <meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="u003\__APP_ID__" />

Can a patch please be written for this? I think it's fair enough to say that this has been going on long enough. Honestly, where'd all the support go for this plugin?

days of frustration and just found this. It's work. But why this not got fixed yet...

Omg this solved the problem for me too ! thanks for the solution !

Thanks @EvgenyMelnikov

OMG

Can confirm this works:

  • open template-AndroidManifest.txt
  • "\ __APP_ID__" to "\u003__APP_ID__"
  • setup GPGS from Unity (press Window/Google Play Services/Setup)

Had the same problem with plugin 0.9.50 and Unity 2018.2.2f1. Utterly baffling. So glad you all are here. I put the u003 after the slash, redid the setup, and voila! It works!

Would have been totally lost without all you brave souls to show me the way. Thank you.

Unity 2018.2.6f1, replacing "__APP_ID__" with "\u003__APP_ID__" in template-AndroidManifest.txt worked for me.

Lost a whole day to figure this out.

Thanks, replacing "_APP_ID_" with "\u003__APP_ID__" in template-AndroidManifest.txt , worked for me

Took me 2 days. Thank you alot!
Also, remember that it is "\u003..." and not "\ u003...". I was under the impression that space doesn't matter.
Unity 2018.2.6f1 👍

What does \u003 actually mean in this context? Looks like some Unicode code point or something like that. But it's not clear who exactly is responsible for interpreting this escaped/encoded thing; which part of pipeline?

In ASCII, 0x03 is the ETX control character ("end of text"). I have no idea what significance it has for the Android build process.

Awesome!!!!!!!!!!!!!!!!!!
Thank you EvgenyMelnikov !!
You saved my life!

Unreal that this issue is still open after almost a year. So much time lost to this bug.

My god, days after this problem and it was this stupid shit...

Thanks for solving it!

Solution. Summary:

  • Go to GooglePlayGamesEditor\template-AndroidManifest.txt
  • Open template-AndroidManifest.txt.
    -Change "\ APP_ID" to "\u003__APP_ID__"
    -setup GPGS from Unity (press Window/Google Play Services/Setup). Then regenerate manifest at Window->GooglePlayGames->Setup->AndroidSetup->Setup.
    I want to express my sincere gratitude to each and every one of you who helped to solve this issue. Thank you!

What does \u003 actually mean in this context? Looks like some Unicode code point or something like that.

I was curious as well and did a little research… when you look at a unicode table you can see, that the characters with the code \u003X – where X is any digit [0-9] – are actually the digits 0 to 9. So whatever digit comes after the 3 defines the unicode for that digit. What comes out is the first digit of the APP ID in unicode, followed by the rest of the number.

So this is not really a fix, but a clever hack/ workaround to trick the system to do the right thing. No idea why the "\ " is there in the first place, because clearly it should just resolve to the APP ID number in the end.

Hi, tried making the following change in the template-AndroidManifest.txt file
"\ APP_ID" to "\u003__APP_ID__"
However the leaderboard is still crashing on saving the score, Can anyone please suggest how to resolve this issue.
Working on unity version 2018.1.8f and GPGS version 0.95.
Thanks.

Hi, tried making the following change in the template-AndroidManifest.txt file
"\ APP_ID" to "\u003__APP_ID__"

It's not necesary to add u003. You need just remove whitespace in template.
android:value="\[whitespace]__APP_ID__" />
android:value="\__APP_ID__" />
after that you need to rebuild manifest (window -> google play games -> setup-> android setup).
OR go to generated manifest %\Assets\GooglePlayGames\PluginsAndroid\GooglePlayGamesManifest.pluginAndroidManifest.xml
and remove whitespace as well.

Hi, tried making the following change in the template-AndroidManifest.txt file
"\ APP_ID" to "\u003__APP_ID__"

It's not necesary to add u003. You need just remove whitespace in template.
android:value="\[whitespace]__APP_ID__" />
android:value="\__APP_ID__" />
after that you need to rebuild manifest (window -> google play games -> setup-> android setup).
OR go to generated manifest %\Assets\GooglePlayGames\PluginsAndroid\GooglePlayGamesManifest.pluginAndroidManifest.xml
and remove whitespace as well.

Hi, tried making the following changes, however now the signIn functionality has stopped working, hence unable to access leaderboard.

Should be fixed in 0.9.52.

Are you going to release version 0.9.52? can't find it in releases

Thanks for noticing will update the releases.
You can get latest version 0.9.57 in the current-build folder.

replace "\ " with "\u003

before:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 232323232323" />
after:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003232323232323" />

Not worked for me. Still getting same issue.

My android manifest already has the "\u003" but still not working, it's crashing when using "PlayGamesPlatform.Activate()"

Unity: 2017.4.15f1
com.google.android.gms.games.unityVersion: 0.9.62
DeltaDNA SDK: deltadna-sdk-v4.12.3
GoogleMobileAds: v3.16

replace "\ " with "\u003

before:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 232323232323" />
after:
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003232323232323" />

Wow, this worked for me. Thanks man @khaledElshimy!

Was this page helpful?
0 / 5 - 0 ratings