I tried to enable Java 8 features in Android Studio like suggested in https://android.com:
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
After that I added compile 'net.sourceforge.streamsupport:streamsupport:1.5.1'
and was able to use lambdas. Since I've done that, the Gradle build takes forever (I killed the process after 20 minutes to try other solutions). My hardware is not pretty good, but still this is not an acceptable time for a build (and it never finished). I also tried to remove this changes, but I face related compilations errors.
I can pull the previous app version from git, but I rather solve these issues to be able to us Java 8 features. Did anyone face this problem and managed to solve it? Thanks.
Check your Internet connection. If internet speed is very slow gradle build will also take long time to build. I check by change my wifi internet connection with another one good speed connection. Now build time is normal.
A Java version between 8 and 18 is required to execute Gradle.
The Jack toolchain is now deprecated, and Java 8 features are available "natively" in Android Studio 3.0.
Rather than trying to get your Gradle builds to go faster with Jack, you should upgrade Android Studio.
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