1. AndroidManifest.xml does not have the right value
原因:
可能發生於你 Import GPGS plugins 多次
或嘗試不同版本的 Plugin
但卻沒清乾淨舊的版本時會遇到以下錯誤訊息
The meta-data tag in your app’s AndroidManifest.xml does not have the right value. Expected 4132500 but found 4242000. You must have the following declaration within the element:
解決:
用 MonoDevelop 或你的 IDE 工具搜尋一下
google_play_services_version
看看有沒有找到錯誤號碼的檔案
有的話就把它刪掉,留下正確的即可
2. LoadScores: 載入排行榜分數閃退
如果想要使用自訂的排行榜 UI
或是要獲得自己和其他人的分數
都會需要用到 LoadScores 這個方法
但剪刀使用 GPGS 在 Github 上的函式後卻閃退了
後來研判是 Google API 的 callback 不是使用到 Main Thread 執行
導致在 callback 進行 UI 處理會閃退
以下是成功 Working 的版本
private LeaderboardScoreData m_scoreData= null; private bool m_isScoreLoaded = false; private void Update() { if ( m_isScoreLoaded ) { // Handling with scores... m_isScoreLoaded = false; } } private void LoadScores() { PlayGamesPlatform.Instance.LoadScores( ID, start, rowCount, collection, time, ( scoreData => { m_scoreData = scoreData; m_isScoreLoaded = true; } ); }
[…] Google Play Game Service CodeLab – Android Google Play Game Service – iOS Google Play Game Service 問題彙整 […]