Default or static interface method used without --min-sdk-version >= 24

后端 未结 4 1367
独厮守ぢ
独厮守ぢ 2021-01-04 00:07

Why do we get this error in Android Studio 3.0 RC1?

 com.android.dx.cf.code.SimException: 
default or static interface method used without --min-sdk-version          


        
相关标签:
4条回答
  • 2021-01-04 00:21

    If the java-library that you're talking about was guava, you can try to upgrade it to the latest android-specific build

    implementation 'com.google.guava:guava:23.0-android'
    

    This fixed for me

    0 讨论(0)
  • 2021-01-04 00:29

    If this error occurs due to Guava, then the solution, as per the official documentation from Google is: https://github.com/google/guava

    Change the dependency to (version is current as of this writing):

    api 'com.google.guava:guava:27.0-android'
    

    This fixed the issue for me.

    0 讨论(0)
  • 2021-01-04 00:34

    From guava v24 we have two alternative versions: Android or JRE. So, in this case you need to include the dependency as:

    compile 'com.google.guava:guava:24.1-android'
    

    Find all the details within the repo: https://github.com/google/guava

    0 讨论(0)
  • 2021-01-04 00:39

    I just found out that it works as expected when I activate the D8 dexer which is planned to be the default for Android Studio 3.1

    In the project gradle.properties, add:

    android.enableD8=true
    

    Now the code compiles as expected and I still get the expected linter messages.

    0 讨论(0)
提交回复
热议问题