0

I got this error: Using Google Play games services requires a metadata tag with the name "com.google.android.gms.games.APP_ID" in the application tag of the manifest for com.awsum.dunnn

Now in my androidmanifest file the name of the package is this by the auto generated Google Play game Setup: com.google.example.games.mainlibproj

I tried to change it to my package, but still the same error. I think somewhere the package name might be off, but I don't know where. I'm still trying to find from where the Setup takes information for the package name, so I could fix it.

EDIT:

This is the manifest:

    <?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin 
for Unity
 Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.awesome.dunnn"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />

<application>

 <!-- Required for Nearby Connections API -->
    <meta-data 
android:name="com.google.android.gms.nearby.connection.SERVICE_ID"
        android:value="" />

    <!-- 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="\ 107********1" />

    <!-- Keep track of which plugin is being used -->
    <meta-data android:name="com.google.android.gms.games.unityVersion"
        android:value="\ 0.9.41" />

    <!-- Build time check to make sure play-services libraries are present -
->
    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>
</manifest>
Oki Doki
  • 179
  • 3
  • 13

2 Answers2

1

In this SO post answer, same error was encountered. What the user did was to add the snippet below in the AndroidManifest.xml under the <application> tag:

<meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="@string/app_id" />

APP_ID is available in the Games Services tab, see screenshot below.

enter image description here

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65
  • I saw that, but there is no string.xml file in Unity. The APP_ID matches the one I have in Games Services so yea. – Oki Doki Sep 28 '17 at 16:42
1

After posting on different forums and everyone either ignoring or giving the same exact answer like the one above(which can't be done in Unity, because there is no string.xml file anywhere in the Assets), I finally solved it.

The problem was that my Google Play manifest was completely ignored when manifests where merged. So I had to overwrite the manifest in Unity.

I'll edit this answer later, so it would be more clearer, but for now refer to this link for overwriting manifest.

Oki Doki
  • 179
  • 3
  • 13
  • Generate your apk, then look into your project folder and find the generated AndroidManifest. I don't remember where it was, so look it up on google or something if you can't find. Then make your own manifest file, copy everything over and add string.xml as well. Then follow that link so you can overwrite the manifest and that's pretty much it. Oh and you need to leave all the other for example google play manifest empty inside or it will merge and create errors. – Oki Doki Oct 31 '17 at 18:07
  • Oki Doki! Thanks for following up, I will go ahead and do that . This issue was so frustrating – squeegene Nov 01 '17 at 18:23
  • can you update your answer with details? its top result in the search and I'm having the same issue. – kyxap Oct 08 '21 at 17:51