I am trying to create an @aar package from my library that will be used as a dependency inside client projects.
In my library module, I use:
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
I want to smooth out the code and make it compatible with Java 7 before reaching client dependencies. This means that I need to actually provide the @aar package, where Lambda functions and all other Java 8 related functions are already ported to Java 7 bytecode.
The problem I am facing is that on the library module using:
apply plugin: 'com.android.library'
the desugaring task is not running, which means the bytecode contains Java 8 imports, for example:
java.lang.invoke.LambdaMetafactory
and this will cause my client to also update its JavaVersion.VERSION_1_8 compilation options, which I want to avoid.
, :
desugaring, com.android.library, com.android.application? , , ?