Hi,
@Noisyfox & @kisg, Moe currently support a partial set of java 8 features and it is based on android 6 (api 23).
As you may know, google has released a while ago the desugaring support which basically allow developers to make use of a greater set of java 8 apis even across on old android apis without complaint by just adding these simple lines in the gradle (android project):
android {
…
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
** sourceCompatibility JavaVersion.VERSION_1_8**
** targetCompatibility JavaVersion.VERSION_1_8**
** }**
//…
}
Java 8 language feature support using desugar
bytecode transformations.
Here is the problem, Moe cannot find java 8 classes that some of my libraries make use of. I am able to run my project from android api 8 until android api 30 without any issues. However, moe still complain about these errors:
dex2oat W 36007 1194688 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/LongUnaryOperator;
dex2oat W 36007 1194688 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Consumer;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Consumer;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiConsumer;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Supplier;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Supplier;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Supplier;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Supplier;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiConsumer;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/beans/ConstructorProperties;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/beans/Transient;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/beans/XMLDecoder;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/beans/XMLEncoder;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/FunctionalInterface;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/LambdaForm$Hidden;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/FileSystemNotFoundException;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Files;
dex2oat W 36007 1194688 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Paths;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/spi/FileSystemProvider;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Path;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/StandardCopyOption;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/concurrent/CompletableFuture;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/concurrent/CompletionException;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/concurrent/CompletionStage;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/concurrent/atomic/LongAdder;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiConsumer;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Consumer;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/BiFunction;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/LongUnaryOperator;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Supplier;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonArray;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonNull;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonObject;
dex2oat W 36007 1194691 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonPrimitive;
dex2oat W 36007 1194688 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonElement;
dex2oat W 36007 1194692 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Lkotlinx/serialization/json/JsonElementsKt;
dex2oat W 36007 1194693 /Users/noisyfox/Documents/projects/moe/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/CopyOption;
I not able to workaround theses errors using proguard as I am using some key features of these libs. These libs are working just fine across all android devices!
Please, Is there any way you could include Java 8+ API desugaring support in the next release so many java/kotlin libs could successfully compile?
Cheers