Home Features Docs Blog Support GitHub

MOE 1.4.3 + Android Studio, cannot link BT library


(Vinogradov Daniil) #1

Hello,
I am new at MOE, I understand the basics of it, and now I am trying to link “atomashpolskiy/bt” library.
And I have some problems with it:

  1. After linking DHT part of library, project crashes on building with a massive error which I’ll attach below, but main part of it: Execution failed for task ‘:moeMainDebugArm64Dex2Oat’.
  2. I need to use Path object but: error: “cannot access Path; class file for java.nio.file.Path not found”
  3. And same with CompletableFuture: “error: cannot access CompletableFuture class file for java.util.concurrent.CompletableFuture not found”

I am using: MacOS 10.13.4, Android Studio 3.1.2, MOE 1.4.3, JDK 10.0.1

That error:
:moeMainDebugArm64Dex2Oat
###########

ERROR LOG

###########

dex2oat I 18258 499100 /Users/rolandvigh/public-repo/aosp/art/dex2oat/dex2oat.cc:2220] /Users/xitrix/.moe/moe-sdk-1.4.2/tools/dex2oat --instruction-set=arm64 --base=0x10000000 --compiler-backend=Quick --generate-debug-info --image=/Users/xitrix/Documents/GitHub/iTorrent-Java-Edition-/build/moe/main/dex2oat/debug-arm64/image.art --image-classes=/Users/xitrix/.moe/moe-sdk-1.4.2/tools/preloaded-classes --oat-file=/Users/xitrix/Documents/GitHub/iTorrent-Java-Edition-/build/moe/main/dex2oat/debug-arm64/application.oat --dex-file=/Users/xitrix/Documents/GitHub/iTorrent-Java-Edition-/build/moe/main/dex/classes.jar:/Users/xitrix/.moe/moe-sdk-1.4.2/sdk/moe-core.dex:/Users/xitrix/.moe/moe-sdk-1.4.2/sdk/moe-ios-retro-dex.jar
dex2oat I 18258 499100 /Users/rolandvigh/public-repo/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/xitrix/Documents/GitHub/iTorrent-Java-Edition-/build/moe/main/dex/classes.jar:/Users/xitrix/.moe/moe-sdk-1.4.2/sdk/moe-core.dex:/Users/xitrix/.moe/moe-sdk-1.4.2/sdk/moe-ios-retro-dex.jar
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/io/UncheckedIOException;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/FunctionalInterface;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/LambdaForm$Hidden;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/MethodHandle;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/MethodHandles$Lookup;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/MethodHandles;
dex2oat W 18258 499115 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/lang/invoke/MethodType;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/net/ProtocolFamily;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/net/StandardProtocolFamily;
dex2oat W 18258 499119 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/net/SocketOption;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/net/StandardSocketOptions;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/channels/SeekableByteChannel;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Path;
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Paths;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/FileSystem;
dex2oat W 18258 499114 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/FileVisitOption;
dex2oat W 18258 499115 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/StandardCopyOption;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/StandardOpenOption;
dex2oat W 18258 499119 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/FileSystems;
dex2oat W 18258 499117 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/Files;
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/StandardWatchEventKinds;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/WatchEvent$Kind;
dex2oat W 18258 499114 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/WatchKey;
~… all the same …~
Ljava/util/function/Consumer;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 18258 499115 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 18258 499118 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Function;
dex2oat W 18258 499114 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Predicate;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/function/Consumer;
dex2oat W 18258 499118 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/LinkOption;
dex2oat W 18258 499115 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/WatchEvent$Kind;
dex2oat W 18258 499117 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/OpenOption;
dex2oat W 18258 499113 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/CopyOption;
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/FileVisitOption;
dex2oat W 18258 499116 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/util/concurrent/CompletableFuture;
dex2oat W 18258 499114 /Users/rolandvigh/public-repo/aosp/art/compiler/driver/compiler_driver.cc:2033] Failed to resolve class Ljava/nio/file/attribute/FileAttribute;
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/dex/verification_results.cc:61] Method processed more than once: void android.icu.text.NumberFormat.()
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/dex/verification_results.cc:61] Method processed more than once: java.lang.String java.lang.AbstractStringBuilder.substring(int)
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/dex/verification_results.cc:61] Method processed more than once: java.lang.String com.android.org.bouncycastle.util.Strings.toLowerCase(java.lang.String)
dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/dex/verification_results.cc:61] Method processed more than once: java.lang.String java.lang.IntegralToString.stringOf(char[])
dex2oat I 18258 499100 /Users/rolandvigh/public-repo/aosp/art/runtime/gc/heap.cc:2729] Explicit concurrent mark sweep GC freed 69049(14MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 14MB/18MB, paused 26us total 10.763ms
dex2oat F 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/oat_writer.cc:649]Unexpected failure to resolve a method: void lbms.plugins.mldht.DHTConfiguration$$Lambda$1.()
dex2oat F 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/oat_writer.cc:655] java.lang.NoClassDefFoundError: lbms.plugins.mldht.DHTConfiguration$$Lambda$1
dex2oat F 18258 499100 /Users/rolandvigh/public-repo/aosp/art/compiler/oat_writer.cc:655] (Throwable with empty stack trace)
NATIVE BACKTRACE:
0 dex2oat 0x000000000cf6c659 _ZN3art7Runtime5AbortEv + 99
1 dex2oat 0x000000000cf90a99 _ZN3art10LogMessageD2Ev + 649
2 dex2oat 0x000000000ce540c7 _ZN3art9OatWriter22InitImageMethodVisitor11VisitMethodEmRKNS_21ClassDataItemIteratorE + 1677
3 dex2oat 0x000000000ce4f567 _ZN3art9OatWriter15VisitDexMethodsEPNS0_16DexMethodVisitorE + 257
4 dex2oat 0x000000000ce4eeb9 _ZN3art9OatWriter19InitOatCodeDexFilesEm + 179
5 dex2oat 0x000000000ce4de93 _ZN3art9OatWriterC2ERKNSt3__16vectorIPKNS_7DexFileENS1_9allocatorIS5_EEEEjmiPKNS_14CompilerDriverEPNS_11ImageWriterEPNS_12TimingLoggerEPNS_7SafeMapINS1_12basic_stringIcNS1_11char_traitsIcEENS6_IcEEEESN_NS1_4lessISN_EENS_17TrackingAllocatorINS1_4pairIKSN_SN_EELNS_12AllocatorTagE7EEEEE + 611
6 dex2oat 0x000000000ccd4a0e _ZN3art7Dex2Oat13CreateOatFileEv + 428
7 dex2oat 0x000000000ccc66a3 main + 611
8 libdyld.dylib 0x00007fff62a3a015 start + 1

dex2oat F 18258 499100 /Users/rolandvigh/public-repo/aosp/art/runtime/runtime.cc:464]Runtime aborting…
Aborting thread:
“main” prio=5 tid=1 Runnable (still starting up)
| group="" sCount=0 dsCount=0 obj=0x0 self=0x7fb134009000
| sysTid=499100 nice=-1 cgrp=default sched=1/31 handle=0x7fff9b067380
| state=? schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7ffee273f000-0x7ffee2747000 stackSize=8MB
| held mutexes= “abort lock” “mutator lock”(shared held)
(no managed stack frames)
Pending exception java.lang.NoClassDefFoundError: lbms.plugins.mldht.DHTConfiguration$$Lambda$1
(Throwable with empty stack trace)Dumping all threads without appropriate locks held: thread list lock
All threads:
DALVIK THREADS (1):
“main” prio=5 tid=1 Runnable (still starting up)
| group="" sCount=0 dsCount=0 obj=0x0 self=0x7fb134009000
| sysTid=499100 nice=-1 cgrp=default sched=1/31 handle=0x7fff9b067380
| state=? schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7ffee273f000-0x7ffee2747000 stackSize=8MB
| held mutexes= “abort lock” “mutator lock”(shared held)
(no managed stack frames)

dex2oat W 18258 499100 /Users/rolandvigh/public-repo/aosp/art/runtime/barrier.cc:96] Attempted to destroy barrier with non zero count -1

FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.

Task failed, you can find the log file here: /Users/xitrix/Documents/GitHub/iTorrent-Java-Edition-/build/moe/main/dex2oat/debug-arm64/Dex2Oat.log
6 actionable tasks: 6 executed

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 20s
Multi-OS Engine module build failed


(Gergely Kis - Migeran) #2

Hi,

MOE 1.4.x is based on Android ART from Android 6. This means that as a rule of thumb: if the library is working on Android 6, then it should work on MOE. On top of stock Android MOE also integrates with Retrolambda, so basic Java 8 features like default methods in interfaces and lambdas are supported, but most of the Java 8 specific APIs are not.

It looks like that this library requires Java 8.

The next major release of MOE will be based on Android P, and it will include support for the new Java 8 APIs.

Best Regards,
Gergely


(Vinogradov Daniil) #3

Thanks for answer, so I’ll wait the release of this new version.