Closed janimm closed 3 years ago
java 1.8 is already set since 3.0.0 with https://github.com/mik3y/usb-serial-for-android/commit/a664082f23e680bbf847ec6bfef67296139f289c is it missing in another gradle file?
I'm not a gradle expert, but this is what I'm experiencing while building our project:
In our build.gradle we have:
dependencies {
...
implementation 'com.github.mik3y:usb-serial-for-android:3.2.0'
}
If I change that to:
dependencies {
...
implementation 'com.github.mik3y:usb-serial-for-android:3.3.0'
}
The build fails with error:
Invoke-customs are only supported starting with Android O (--min-api 26)
Which can be fixed by adding this to build.gradle:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
I know this is not a bug and fix is easy, but something has happened between 3.2.0 and 3.3.0 to require this change into the build.grade.
I see. Google mentions here:
After that, for each module that uses Java 8 language features (either in its source code or through dependencies), update the module's build.gradle file
so any app using this library also has to use Java 8. With a commit between 3.2.0 and 3.3.0 a Java 8 feature (method reference) is used, so this option becomes effective now.
I can mention this in the wiki page, but searching for this error message also quickly shows the resolution.
3.3.0 causes build error:
If can be fixed by adding following to the build.gradle:
3.2.0 did not have this issue.