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 >= 24
According to the android docs, the feature "Default and static interface methods" is compatible with Any min-sdk version.
I tracked this down to a java-library that calls Comparator.naturalOrder() - which has been added in API level 24.
So I would not expect any error-message at all for this code in a java-library.
When I use the code in my own android-app or lib java code, I see the correct lint message: "Call requires API level 24)"
Is the error-message wrong or am I missing something?
To change Android minSdkVersion in Flutter for the project created after the 2.8 update, you have to make changes in the local. properties file and then reference the new variable from the local. properties file inside the build. gradle file.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With