2016-10-08 49 views
3

按照google play games plugin for unity的說明,我無法正確設置它。我的應用程序在登錄時崩潰,並輸出以下日誌(沒有更多詳細信息)。我找不到可能的原因,搜索似乎沒有任何有用的提示。統一設置Google Play服務出錯

顯示實際的錯誤爲:

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所需的步驟,我已經成功應用,爲GooglePlayGame插件統一。什麼可能是錯誤信息的原因?

回答

1

問題是由Google Play服務中的多個應用程序配置引起的。儘管遊戲服務面板僅顯示一個包含我的包名稱的應用程序,但之前在谷歌雲服務中配置了相同應用程序的多個實例,以前用於Google雲消息傳遞和其他服務。只有關閉所有服務,刪除應用程序並耐心地在Google Play服務中創建一個統一的應用程序配置時,問題才得以解決。

2

如果我們指的是實際的錯誤,如圖中的日誌輸出,該問題是由你的清單中聲明的​​application ID這實際上是開發商承諾的頂部設置錯誤之一如本video引起的。

要解決這種錯誤,請檢查以下內容:

對於Android的:

  • 請確認@string/app_id資源的價值應用程序的數字ID相符。這個資源的值應該只包含數字。例如:

    <string name="app_id">123456789012</string>

    警告:不要使用完整的客戶端ID(1233456789012.apps.googleusercontent.com)爲您的應用程序ID。這將導致錯誤。

對於iOS:

  • application_ID是,谷歌Play開發者控制檯分配到項目的數量。請注意,這與您的Apple application_ID不一樣。

然後,在檢查了application ID之後,還請檢查certificate fingerprint。請注意的是:

如果您使用的是調試證書調試你的遊戲,但已經被配置爲使用您的釋放證明的遊戲服務,您應該使用相同的包名和您的調試證書的SHA1指紋添加第二個關聯應用。這將允許您使用調試或發行證書籤署應用程序。

有關其他提示,請參閱這些相關資源:

最後,這Q&A thread也可能有所幫助,其中建議這GitHub post

1

我也遇到了這個問題。這是我的解決方案:

刪除舊版本的GooglePlayService和Admob插件並導入新版本。

打開Android SDK管理器(在團結,窗口 - >谷歌玩遊戲 - >下載 - >谷歌播放Gamse SDK(安卓)),更新以下的: enter image description here

然後嘗試建立古爾播放服務。

另外,GooglPlayServices和Admob的當前版本都導入了PlayServicesResolver/Editor/Google.JarResolverLib.dll(JarResolverLib.dll),只是刪除了Google.JarResolerLib.dll。

希望這能幫助你!