安裝Google Play服務插件和Firebase消息傳遞插件後,我無法進行構建。我正在使用兩者的最新版本。我得到「無法將類轉換爲dex格式」錯誤。衝突的兩個庫是play-services-auth-10.2.6和play-services-base-11.2.0。 Google Play服務解析器爲我抓取這兩個庫。任何人都有解決方案?Unity 5.6:Google Play服務和Firebase消息傳遞插件不兼容
回答
我知道它與最新的谷歌播放服務解析器一起工作。
我一直在使用谷歌播放服務插件中的GPGSDependencies.xml和PluginVersion.cs文件。我試圖讓庫的版本一致。
我確實設法獲得相同的庫版本,但這確實解決了DEX格式問題,但是當我打電話來驗證Google帳戶時,我的應用程序崩潰了。
這是我做過什麼: 在GPGSDependencies.xml我在這行改變了10+到11.1+
<androidPackage spec="com.google.android.gms:play-services-games:10+">
...
<androidPackage spec="com.google.android.gms:play-services-nearby:10+">
...
<androidPackage spec="com.google.android.gms:play-services-auth:10+">
而且我也改變了PluginVersion.cs行至
// used to check for the correct min version or play services: 11.2
public const int MinGmsCoreVersionCode = 11200000;
// used to get the right version of dependencies.
public const string PlayServicesVersionConstraint = "11.1+";
from
// used to check for the correct min version or play services: 10.2
public const int MinGmsCoreVersionCode = 10200000;
// used to get the right version of dependencies.
public const string PlayServicesVersionConstraint = "10+";
PluginVersion.cs更改在這裏提到: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1892#issuecomment-325555313。
這並沒有解決我所有的問題,但也許它會幫助你。
讓我知道如果你設法解決它,我仍然在尋求解決方案。
供參考:Firebase SDK的4.2.0版本https://firebase.google.com/support/release-notes /unity#4.2.0包含Play Services Resolver 1.2.53版本(https://github.com/googlesamples/unity-jar-resolver),可自動修復衝突的Play Services版本。 – stewartmiles
- 1. Ionic 2:Firebase雲消息傳遞和Google服務錯誤
- 2. Unity Google Play服務
- 3. Unity Android Google Play服務 - 發送字符串消息
- 4. Google Play服務Unity3d插件
- 5. 處理Google Play服務更新消息
- 6. 關於Cocoapods和Firebase /消息傳遞的Unity iOS構建錯誤
- 7. Firebase雲消息傳遞和C#服務器端代碼
- 8. 無法從服務器發佈消息:Google雲消息傳遞
- 9. Firebase消息服務
- 10. firebase雲消息傳遞服務中的多播ID
- 11. Restful服務和消息傳遞
- 12. Firebase:如何確保與各種版本的Google Play服務兼容?
- 13. cordova phonecalltrap插件和google play設備兼容性
- 14. Xcode 8和Firebase雲消息傳遞
- 15. Firebase通知和雲消息傳遞
- 16. Firebase通知 - Firebase雲消息傳遞
- 17. 在Firebase雲消息傳遞中管理服務器密鑰
- 18. Chrome上的Firebase消息傳遞服務工作者
- 19. 如何在服務器端實現firebase雲消息傳遞?
- 20. Firebase消息傳遞服務(用於通知)是否粘滯?
- 21. Firebase消息傳遞錯誤:消息傳遞/權限被阻止
- 22. Unity Google Play服務插件API與Show Leaderboard UI功能不同步?
- 23. Google雲消息傳遞業務設置
- 24. 當屏幕關閉時,Firebase消息傳遞服務沒有收到消息
- 25. 擁有舊版Google Play服務的Firebase
- 26. 兼容性MySQL 5.6和5.7
- 27. Google Play兼容性問題
- 28. Axis,Java消息傳遞服務和MIME頭文件
- 29. 在沒有Google Play服務的設備中使用Firebase雲消息
- 30. Android和Google Play兼容性的功能
我建議使用一個版本只喜歡10.2.6版或11.2.0和不混合。關於你的錯誤,一些論壇認爲這可能與重複的瓶子有關,你應該刪除它們,因此只會使用一個副本。檢查此[SO帖子](https://stackoverflow.com/questions/44468420/unity-error-unable-to-convert-classes-into-dex-format)。 – noogui
發佈你的錯誤和build.gradle –
錯誤最終是這樣的:com.android.dex.DexException:多個dex文件定義Lcom/google/android/gms/auth/api/signin/internal/zzf; –