[Android] Error: Default interface methods are only supported starting with Android N (–min-api 24): java.util.Collection com.google.common.collect.BiMap.values()

升級完Android Studio 到 3.2.1 之後,重build 專案顯示這個 Error Message:

Error: Default interface methods are only supported starting with Android N (--min-api 24): java.util.Collection com.google.common.collect.BiMap.values()

解法:

as CommonsWare mentioned, for reference add this inside the android {...} closure in the build.gradle for your app module to resolve issue:

android {
...
  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
...
}

 

說明:就是增加上面 compileOptions 即可。

相關文章

寫留言

你的電子郵件位址並不會被公開。 必要欄位標記為 *