Android does not support Java 8 . It only supports up to Java 7 (if you have kitkat) and still it doesn’t have invokedynamic, only the new syntax sugar. If you want to use lambdas, one of the major features of Java 8 in Android, you can use gradle-retrolamba.
Read moreWhat are new features in Java 8?
Some of the important Java 8 features are;
Read moreDoes Android support Java 17?
As per the docs, JDK 17 isn’t supported yet in Android Studio . Actually, JDK 11 was supported starting from version 4.2 which was released in April 2021.
Read moreWill Android support Java 11?
The gap between Java 8 and Java 9 in terms of build compatibility has been overcome and more modern Java versions (up to Java 11) are officially supported on Android . On top of that, Android Gradle Plugin 7.0. 0 now requires JDK 11 for running Gradle builds.22 Ara 2020
Read moreDoes gradle work with Java 11?
Gradle 5.0 now supports Java 11 . Developers can run Gradle builds with JDK 11. This release also introduces dependency version alignment, which allows different modules belonging to the same logical group (a platform ) to have identical versions in a dependency graph.
Read more