Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unity3d 在unity中设置Google play服务时出错_Unity3d_Google Play Services - Fatal编程技术网

Unity3d 在unity中设置Google play服务时出错

Unity3d 在unity中设置Google play服务时出错,unity3d,google-play-services,Unity3d,Google Play Services,按照上的说明,我无法正确设置它。我的应用程序在登录时崩溃,日志输出如下(没有更多详细信息)。我没有运气找到可能的原因,搜索似乎没有任何有用的提示 实际错误显示为: Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID 完整的日志输出: 10-08 19:43:49.581 25688-25734/? E/linker: readli

按照上的说明,我无法正确设置它。我的应用程序在登录时崩溃,日志输出如下(没有更多详细信息)。我没有运气找到可能的原因,搜索似乎没有任何有用的提示

实际错误显示为:

Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID
完整的日志输出:

10-08 19:43:49.581 25688-25734/? E/linker: readlink('/proc/self/fd/49') failed: Permission denied [fd=49]
10-08 19:43:49.581 25688-25734/? E/linker: warning: unable to get realpath for the library "/data/data/com.testcompany.testapp/app_.gpg.classloader/d75c8e1bbeab9e1ddffb9d332585db71.dex". Will use given name.
10-08 19:43:49.667 25688-25734/? W/PopupManager: You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not work as expected in multi-screen environments
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Auth operation started: SIGN IN
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Connecting to Google Play...
10-08 19:43:49.802 10946-10956/? W/GamesServiceBroker: Client connected with SDK 9683000, Services 9683438, and Games 37240038
10-08 19:43:49.837 10946-26540/? E/ValidateServiceOp: Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID.
10-08 19:43:49.842 25688-25688/? D/AndroidRuntime: Shutting down VM
10-08 19:43:49.846 25688-25688/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.testcompany.testapp, PID: 25688
                                                   java.lang.Error: FATAL EXCEPTION [main]
                                                   Unity version     : 5.4.0f3
                                                   Device model      : LGE Nexus 5
                                                   Device fingerprint: google/hammerhead/hammerhead:6.0/MRA58K/2256973:user/release-keys

                                                   Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
                                                       at com.google.android.gms.common.internal.zze$zza.zzc(Unknown Source)
                                                       at com.google.android.gms.common.internal.zze$zza.zzv(Unknown Source)
                                                       at com.google.android.gms.common.internal.zze$zze.zzauc(Unknown Source)
                                                       at com.google.android.gms.common.internal.zze$zzd.handleMessage(Unknown Source)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:148)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

我已经采取了生成OAuth2客户端ID所需的步骤,并成功地将其应用于unity中的GooglePlayGame插件。错误消息的原因可能是什么?

如果我们参考日志输出中显示的实际错误,则问题是由清单中声明的
应用程序ID引起的,该ID实际上是开发人员犯下的最严重的安装错误之一,如本文所示

要解决此类错误,请检查以下内容:

适用于Android:

  • 请验证
    @string/app_id
    资源的值是否与应用程序的数字id匹配。此资源的值应仅包含数字。例如:

    123456789012

    警告:不要使用完整的客户端ID(
    1233456789012.apps.googleusercontent.com
    )作为您的应用ID。这将导致错误

对于iOS:

  • application\u ID
    是Google Play开发者控制台分配给您的项目的编号。请注意,这与您的Apple
    应用程序\u ID
    不同
然后,在检查
应用程序ID
后,请同时检查。请注意:

如果您正在使用调试证书调试游戏,但已使用发行证书配置游戏服务,则应使用相同的软件包名称和调试证书的SHA1指纹添加第二个链接应用。这将允许您登录到应用程序,无论它是使用调试证书还是发布证书签名的

有关其他提示,请参阅以下相关资源:

  • -描述常见Google Play games服务设置陷阱和场景的视频
  • -开发者文档,描述如何在开发Android游戏时解决问题

最后,这也可能有助于提出这一建议

问题是由Google play services中的多个应用程序配置引起的。尽管游戏服务面板只显示了一个使用我的软件包名称的应用程序,但在谷歌云服务中,有多个相同应用程序的实例在之前为谷歌云消息和其他服务配置。只有当我关闭所有服务、删除应用程序并耐心地在Google play services中创建一个统一的应用程序配置时,问题才得以解决。

我也遇到了这个问题。以下是我的解决方案:

删除旧版本的GooglePlayService和Admob插件并导入新插件

打开Android SDK管理器(在Unity中,窗口->Google Play Games->下载->Google Play Gamse SDK(Android)),更新以下内容:

然后尝试设置Goole Play服务

另外,GooglPlayServices和Admob的当前版本均导入PlayServicesResolver/Editor/Google.JarResolverLib.dll(JarResolverLib.dll),只需删除Google.JarResolverLib.dll即可

希望这能帮助你