Unity 游戏在登录 Google Play 游戏时崩溃

Unity game crashes when signing in to Google Play Games

我收到此错误:使用 Google Play 游戏服务需要在 com.awsum.dunnn

的清单的应用程序标签中使用名称为 "com.google.android.gms.games.APP_ID" 的元数据标签

现在在我的 androidmanifest 文件中,包的名称是自动生成的 Google 玩游戏设置:com.google.example.games.mainlibproj

我尝试将其更改为我的包,但仍然出现相同的错误。我认为包名称可能在某处关闭,但我不知道在哪里。我仍在尝试查找安装程序从何处获取包名信息,以便修复它。

编辑:

这是清单:

    <?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>

在此SO post answer中,遇到了同样的错误。用户所做的是在 <application> 标签下的 AndroidManifest.xml 中添加以下代码段:

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

APP_ID 游戏服务 选项卡中可用,请参见下面的屏幕截图。

在不同的论坛上发帖后,每个人要么忽略要么给出与上面完全相同的答案(这在 Unity 中无法完成,因为没有 string.xml文件在Assets的任意位置),我终于解决了。

问题是我的 Google 播放清单在合并清单时被完全忽略了。所以我不得不在 Unity 中覆盖清单。

我稍后会编辑这个答案,这样会更清楚,但现在请参考 this link 覆盖清单。