Google Play Services IncompatibleClassChangeError

之前工作在接第三方登入 SDK 時,遇到 GoogleApiClient.connect()' was expected to be of type interface but was found to be virtual 這個錯誤。

原因

查一查發現是第三方登入 SDK 使用的 Google Play Services 是 7.8.* 以下的版本,而我是引用 8.* 以上的版本。

Google Play Services Android SDK 的 GoogleApiClient 自 8.1 版(2015/08)開始是 abstract class,在此之前是 interface。

解決方法

兩種解決方法。 一是請對方升級 Google Play Services 程式庫, 二是專案的 com.google.android.gms:play-services 只能用 7.8.0。

後來我們是採用方法一,而對方開發者也知道引用的 Google Play Services SDK 太舊要處理,所以都順便解決了,至少升到 8.4.0。

References

相關文章

Unity Resources 系統的最佳實務做法

Resources 的最佳做法 別用 Resources 別用 Resources 別用 Resources 因為很重要,所以要講三次。為什麼呢?理由有三。 細粒度的記憶體控管會更困難。 不當使用 Resources 資料夾會導致 app 啟動時間、建

更多

LeetCode Problems: 561. Array Partition I

題目資訊 名稱:Array Partition I 分類:Algorithms 編號:561 難度:Easy 標籤:Array 網址:https://leetcode.co

更多

Hexo 插件載入地雷

摘要 剛開始學習如何使用 hexo 弄個靜態部落格,也弄了個網域。而在使用插件後,就發生災難了,無法 deploy。此文是記錄為什麼會遇到此問題,以及記錄

更多