Delphi 11 建立一个新的 Multi-Device Application 编译成app的时候报错
报错信息
[PAClient Error] Error: E7688 Unable to execute '"E:\Program\Java\jdk1.8.0_301\bin\java.exe" -cp "e:\program\embarcadero\studio\22.0\bin\Android\r8-3.3.28.jar" com.android.tools.r8.D8 --release --min-api 23 --output "E:\Data\DelphiProject11\测试安卓证书\Android64\Debug\Project2.classes" @"E:\Data\DelphiProject11\测试安卓证书\Android64\Debug\dex_list.txt"' (Error 1)
[PAClient Error] Error: E7688 Error in e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex:
[PAClient Error] Error: E7688 Type androidx.collection.ArraySet is defined multiple times: e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex, e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.0.0.dex.jar:classes.dex
[PAClient Error] Error: E7688 Compilation failed
[PAClient Error] Error: E7688 Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
[PAClient Error] Error: E7688 Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex
[PAClient Error] Error: E7688 at Version.fakeStackEntry(Version_3.3.28.java:0)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:27)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.b(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:2)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:17)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:85)
[PAClient Error] Error: E7688 ... 1 more
[PAClient Error] Error: E7688 Caused by: com.android.tools.r8.internal.f: Type androidx.collection.ArraySet is defined multiple times: e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex, e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.0.0.dex.jar:classes.dex
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:33)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:10)
[PAClient Error] Error: E7688 at java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:1990)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:6)
[PAClient Error] Error: E7688 at com.android.tools.r8.graph.B2$a.e(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
[PAClient Error] Error: E7688 at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:105)
[PAClient Error] Error: E7688 at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:25)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.d(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:606)
[PAClient Error] Error: E7688 at com.android.tools.r8.D8.c(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:1)
[PAClient Error] Error: E7688 at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:24)
[PAClient Error] Error: E7688 ... 5 more
Failed
看到了这行报错
[PAClient Error] Error: E7688 Type androidx.collection.ArraySet is defined multiple times: e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.1.0.dex.jar:classes.dex, e:\program\embarcadero\studio\22.0\lib\android\Debug\collection-1.0.0.dex.jar:classes.dex
发现是jar包同时使用了不同的版本导致的,于是要去掉一个,保留最新版本即可
找到该项目的Libraries,将有重复名称但是版本不同的jar包 disable 掉
然后重新build,就通过了