2017年4月6日 星期四

Unity3d 同時使用 google play service 與 admob

之前有寫過這2個外掛合用需要做些修改,現在不用了。

Unity3D 的版本 5.3.4f1

play-games-plugin-for-unity 版本 0.9.36
https://github.com/playgameservices/play-games-plugin-for-unity

Google Mobile Ads Unity Plugin 版本 v3.4.0
https://github.com/googleads/googleads-mobile-unity/releases/tag/v3.4.0

2個外掛換了最新的版本,主要是想試試獎勵式廣告。
在admob上設好後,等一段時間再試,才會成功,基本上沒什麼問題,
要注意的是 google play service 出現2個警告:

Found dependencies: com.android.support:support-v4 required by (this app)

WARNING: No compatible versions of com.android.support:support-v4 required by (com.google.android.gms:play-services-basement:9.4.0), will try using the latest version 23.4.0

但還是可以正常使用登入與遊戲存檔和顯示廣告。

提一下碰到的坑,Android SDK更新如下:(好久沒更新了)
Android Support Repository 36 -> 47
Google Play services 32 -> 39
Google Repository 32 -> 46
Intel x86 Emulator Accelerator(HAXM installer) 6.0.3 -> 6.1.1

更新後遊戲內登入google就會crash,我猜是Google Play services這個更新的問題,
所以我先回復成舊版,讓功能正常比較重要。