Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Android manifest doesn't contain App ID

Discussion in 'Android' started by Jqob, Mar 27, 2019.

  1. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    I think I've figured out why my game won't authenticate google play services. I checked the Androidmanifest.xml after building the game and it doesn't contain the App ID...

    The first point in this guide

    https://developers.google.com/games/services/android/troubleshooting

    ("Check your metadata tags") says that it should look like this:

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

    but mine looks like this:

    <meta-data android:name="unity.build-id" android:value="ce14d4a1-####-####-####-8c22e821c955" />

    I've tried doing the android set up again entering the resources from my developer console but it still exports it like this. Anyone know something?
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,858
    Not sure what plugin you are using for Google play services but you need to have the app_id listed in the manifest to work properly.
     
  3. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Im using GooglePlayGamesPlugin-0.9.62. Also have SDK and JDK attached to unity. I don't know why it doesn't contain app_id... What should I do?
     
  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,858
    Have you done the setup by entering clientid?
     
  5. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Yeah doesn't seem to make a difference
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please show your manifest now, with the app_id
     
  7. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Code (JavaScript):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="#############" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
    3.   <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
    4.   <application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:isGame="true">
    5.     <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
    6.       <intent-filter>
    7.         <action android:name="android.intent.action.MAIN" />
    8.         <category android:name="android.intent.category.LAUNCHER" />
    9.         <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    10.       </intent-filter>
    11.       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    12.     </activity>
    13.     <meta-data android:name="unity.build-id" android:value="ba19888d-e96a-4897-bcbe-45f4e9448e37" />
    14.     <meta-data android:name="unity.splash-mode" android:value="0" />
    15.     <meta-data android:name="unity.splash-enable" android:value="True" />
    16.   </application>
    17.   <uses-feature android:glEsVersion="0x00020000" />
    18.   <uses-permission android:name="android.permission.INTERNET" />
    19.   <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
    20.   <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    21.   <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
    22.   <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
    23. </manifest>
     
    Last edited: Mar 29, 2019
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm not seeing the app_id? I see a build id, but not an app id. Can't you just manually try making the entry?
     
  9. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Where? I've exported the game as APK and am just viewing the Temp folder to see if the manifest is correct. How do I edit it manually?
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You could export to a Gradle project, edit the manifest, and build in Android Studio. I've done the same thing here. Granted a bit of a pain.
     
  11. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    ok i've exported it as project and now there is a folder named GooglePlayGamesManifest.plugin with AndroidManifest.xml containing this:

    Code (JavaScript):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!-- This file was automatically generated by the Google Play Games plugin for Unity
    3.      Do not edit. -->
    4. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    5.     package="com.google.example.games.mainlibproj"
    6.     android:versionCode="1"
    7.     android:versionName="1.0" >
    8.  
    9.     <uses-sdk android:minSdkVersion="14" />
    10.  
    11.  
    12.  
    13.     <application>
    14.  
    15.  
    16.  
    17.         <!-- The space in these forces it to be interpreted as a string vs. int -->
    18.         <meta-data android:name="com.google.android.gms.games.APP_ID"
    19.             android:value="\u########" />
    20.  
    21.         <!-- Keep track of which plugin is being used -->
    22.         <meta-data android:name="com.google.android.gms.games.unityVersion"
    23.             android:value="\u0030.9.62" />
    24.  
    25.         <activity android:name="com.google.games.bridge.NativeBridgeActivity"
    26.             android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    27.     </application>
    28. </manifest>
    29.  
    30.  
    and there is also a folder src/main which contains also AndroidManifest.xml which is exactly the same as I posted before in this thread.
    What should I do with this?
     
    Last edited: Mar 29, 2019
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    As a test, edit your AndroidManifest.xml, add the APP_ID, and build in Android Studio. However, something does not seem right, these steps should not be necessary.
     
  13. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    I've opened the AndroidManifest.xml in GooglePlayGamesManifest.plugin folder and changed the android:value="\u003412655711730" /> to android:value="#########" /> where ######### is my app id. Built an APK with android studio and uploaded it to google store. Now when I open my game it starts signing in and then my app crashes instantly.

    What can be the problem?... i've been trying to get gpgs to work for the past 4 days ...
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I was referring to the src/main manifest. And you certainly don't need to upload to Google store to test, just install directly on your device via USB.
     
  15. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Well if I try adding it there I get an error:

    Manifest merger failed : Attribute meta-data#com.google.android.gms.games.APP_ID@value value=(#########) from AndroidManifest.xml:14:67-95
    is also present at [:GooglePlayGamesManifest.plugin] AndroidManifest.xml:20:13-46 value=(\u003412655711730).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:14:5-98 to override.


    Edit: Okay I added the tools:replace="android:value" in there and now my game connects to gpgs sucessfuly. Damn, finally. Thanks for your help! Is there any way tho to make the AndroidManifest export correctly in unity so I dont have to build it in Android Studio?
     
    Last edited: Mar 29, 2019
  16. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,858
    Obviously this is how it should be by default. I suggest to try downloading a older release from GPGS github and give a try. As @JeffDUnity3D said, there is something wrong going on your setup.
     
  17. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    Tried installing 0.9.58 but still the problem exists
     
  18. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,858
    Ok. You can raise an issue on github repo to see if its a known issue.
     
  19. Jqob

    Jqob

    Joined:
    Dec 20, 2018
    Posts:
    34
    SOLVED: installed the newest version of Unity
     
    Voxel-Busters likes this.
  20. michal-zetkowski

    michal-zetkowski

    Joined:
    Mar 11, 2015
    Posts:
    279
    Hey, I'm facing the same issue. My game wouldn't authenticate in Google Play Serivices, I followed the troubleshooting guide (https://developers.google.com/games/services/android/troubleshooting) and got stuck on step one. It turns out that App ID is not included in Androidmanifest.xml. One thing to note here - if I use Internal Build System, android manifest is ok. The issue only happens if I use Gradle. I need to use it though if I want to upload the game to Google Play.

    As suggested by Jqob, I tried it with different versions of Unity. I tested on 2018.4.21f1, 2018.4.1f1 and 2019.3.5f1. All versions failed. Next, I tried to verify if my setup in Google Play Games plugin (v0.10.08) is correct, I copied Resources Definition from Google Play Developer Console and GPGSIds file is created, so I guess it's fine. I've run out of ideas for debugging this issue, could anyone help?
     
  21. Aokkii

    Aokkii

    Joined:
    Nov 3, 2013
    Posts:
    117
    *bump

    same happening to me on unity 2020.b8 but in this case with the admob plugin, the manifest that contains the admob app id doesnt get merged into the final apk manifest.

    filled a bug report
    case #1245611