Google 播放服务和 Unity3D 错误
Google Play Services and Unity3D error
我在游戏中使用 official Google plugin for Unity3D 获取成就和排行榜,但是当我尝试调用 Google Play Login 时出现错误:
E/GamesNativeSDK﹕ Exception in dalvik/system/DexClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.games.NativeSdkEntryPoints" on path: DexPathList[[zip file "/data/data/com.crazylabs.tabreak/app_.gpg.classloader/de80b70ed0da0dfe988a41fa560612ee.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
06-19 18:02:45.058 25436-27013/? E/ValidateServiceOp﹕ Missing metadata tag with the name "com.google.android.gms.appstate.APP_ID" in the application tag of the manifest for com.company.game
06-19 18:02:45.105 25436-27012/? E/ValidateServiceOp﹕ 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
Android 清单:
....
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="xxxxxxxxxxxxx" />
....
您正在使用 com.google.android.gms.appstate.APP_ID
,但错误提示您需要 com.google.android.gms.games.APP_ID
。
此外:确保将元数据标记放在清单中的 <application>
标记内。
最后,您应该使用字符串文件夹中的应用程序 ID 作为 android:value
属性。最后它应该是这样的:
<application>
...
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
....
</application>
希望对您有所帮助!
我在游戏中使用 official Google plugin for Unity3D 获取成就和排行榜,但是当我尝试调用 Google Play Login 时出现错误:
E/GamesNativeSDK﹕ Exception in dalvik/system/DexClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.games.NativeSdkEntryPoints" on path: DexPathList[[zip file "/data/data/com.crazylabs.tabreak/app_.gpg.classloader/de80b70ed0da0dfe988a41fa560612ee.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
06-19 18:02:45.058 25436-27013/? E/ValidateServiceOp﹕ Missing metadata tag with the name "com.google.android.gms.appstate.APP_ID" in the application tag of the manifest for com.company.game
06-19 18:02:45.105 25436-27012/? E/ValidateServiceOp﹕ 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
Android 清单:
....
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="xxxxxxxxxxxxx" />
....
您正在使用 com.google.android.gms.appstate.APP_ID
,但错误提示您需要 com.google.android.gms.games.APP_ID
。
此外:确保将元数据标记放在清单中的 <application>
标记内。
最后,您应该使用字符串文件夹中的应用程序 ID 作为 android:value
属性。最后它应该是这样的:
<application>
...
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
....
</application>
希望对您有所帮助!