2016年9月8日 星期四

Unity3D No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').


在Unity3D 5.3 加上google play service的功能會先去下載下面的plugin
https://github.com/playgameservices/play-games-plugin-for-unity
不意外的,又有如標題的錯誤了.

大部份解法都是去android sdk目錄下的 extras\google\google_play_services 找檔案來用,但我實在是找不到那些神奇的檔案。
不過下面這個網址倒是有不一樣的解法,可以參考看看
https://app-c.net/tutorial/unity/version5_2/

他是直接把 @integer/google_play_services_version 這變數換成字串,如下
<meta-data android:name="com.google.android.gms.version"
android:value="4323000" />

到這裡可以編釋了,過了一段時間回頭看這個值又變回@integer/google_play_services_version了,估計是在
Window->GooglePlayGames->setup->Android setup...
的設定完成後就變回去了,所以說不定一開始把這個欄位刪除也可以先編釋。

順便提一下使用EnableSaveGames()碰到的問題:
在設定PlayGamesClientConfiguration時,有加上EnableSaveGames(),而且
在google play開發平台上該設定的都有設定,但登入後遊戲就是會跳掉,那麼可參考如下:
https://developers.google.com/games/services/console/configuring
其實就是進入手機上的設定->應用程式->Google Play 服務->管理空間->清除所有資料。
就沒問題了。害我以為改錯什麼,又浪費了我好幾個小時...

沒有留言:

張貼留言