The library I\'m using is bychan, I can\'t even include it in a Nougat empty app project either loaded as module or through jar.
So this is an examp
Overall set up looks good to me except for the Java JDK 1.8
part.You need to set a correct path to JDK installation folder in Android Studio in order to use all the new Java 8 features.
Android SDK < 24 does not support java.util.function.Function
and java.util.function.Predicate
interfaces because Java 8 allows functional interfaces to contain default methods which is only supported in SDK 24 and above. I had this problem when I was using consumers, and the way I fixed it was to create my own clown of java.util.function.Consumer
interface without all the default methods.
You can also fix this issue by increasing the minimum SDK of your app to 24.
Update
Add the following to your build.gradle
file
defaultConfig {
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
I would not suggest to use java 8. It is not supported nowadays. But, even, it will: remember, that each devices has got its own java machine that will not update. I mean, if you wanna be sure your app works properly setup your project as java 6. Old devices this never support up-to-date JMV
Read this discussion too
Which JDK version (Language Level) is required for Android Studio?