TurboMagic 92 Posted December 10, 2023 Hello, when compiling my app (the Hash FMX demo from this project: DelphiEncryptionCompendium) with Delphi 12 for Android 32 bit debug mode I get this failure message, while the same thing just works in 11.3. Compiling the FMX cipher demo for Android with 12.0 works though (I just uploaded a new aab for app store publication). Looking at the failure messages I wonder where on earth I should have gotten > 65536 methods in this project?! My 12.0 installation is a standard one with the standard SDK/NDK and Java brought by the Delphi installation. [PAClient Fehler] Fehler: E7688 ""C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot\bin\java.exe" -cp "c:\program files (x86)\embarcadero\studio\23.0\bin\Android\r8-8.0.40.jar" com.android.tools.r8.D8 --release --min-api 19 --output "D:\Projekte\DECGitMaster\Compiled\BIN_IDExx.x_Android__Demos\Hash_FMX.classes" @"D:\Projekte\DECGitMaster\Compiled\BIN_IDExx.x_Android__Demos\dex_list.txt"" kann nicht ausgeführt werden (Fehler 1) [PAClient Fehler] Fehler: E7688 Picked up JAVA_TOOL_OPTIONS: [PAClient Fehler] Fehler: E7688 Error: Cannot fit requested classes in a single dex file (# methods: 86037 > 65536). Try supplying a main-dex list [PAClient Fehler] Fehler: E7688 Compilation failed [PAClient Fehler] Fehler: E7688 Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:119) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.main(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:5) [PAClient Fehler] Fehler: E7688 Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null [PAClient Fehler] Fehler: E7688 at Version.fakeStackEntry(Version_8.0.40.java:0) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:74) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:27) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:26) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.b(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:2) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:26) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.b(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:13) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:24) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:106) [PAClient Fehler] Fehler: E7688 ... 1 more [PAClient Fehler] Fehler: E7688 Caused by: com.android.tools.r8.utils.b: Cannot fit requested classes in a single dex file (# methods: 86037 > 65536) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.E2.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:21) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.E2.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:26) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.dex.t0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:228) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.dex.o0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:9) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.dex.k.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:51) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.dex.k.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:157) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.d(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:152) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.D8.c(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:1) [PAClient Fehler] Fehler: E7688 at com.android.tools.r8.utils.N0.a(R8_8.0.40_1caf5950b946297b5c46a21a695cd28795208d72fd17f5129543b31a15a067c2:23) [PAClient Fehler] Fehler: E7688 ... 6 more Anybody any clue about the reason for this and how to fix it? CHeers TurboMagic Share this post Link to post
Dave Nottage 557 Posted December 10, 2023 8 hours ago, TurboMagic said: I get this failure message, while the same thing just works in 11.3 Check the minSdkVersion value in your projects AndroidManifest.template.xml file. If it's below 21, the packaging tools are unable to use multidex, thus the error. The > 65536 methods refers to how many methods are included in the jar files (in Project Manager, in the Libraries node under the relevant Android target), which grew substantially from Delphi 11.3 to Delphi 12. If the minSdkVersion value is %minSdkVersion%, the IDE replaces it with the default supported value which is 23, in the resulting AndroidManifest.xml in the project output. If this is the case for you, there may be some other configuration issue. 2 Share this post Link to post
Dalija Prasnikar 1396 Posted December 11, 2023 Another solution that also reduces the binary size is disabling unnecessary Java libraries. By default projects include all kinds of things, like Billing, FireBase, various Google Play services... and if they are not used in the application, they will just be a dead weight. 1 1 Share this post Link to post
guarasemini 1 Posted December 14, 2023 i had somethling like that. Expand your target platforms, go to android 32 and 64, libraries, click with left button and select "revert system files to default" Share this post Link to post
dkboxfine 0 Posted February 1 On 12/10/2023 at 7:34 AM, TurboMagic said: Could you solve it?, the same thing happens to me Share this post Link to post
George Birbilis 1 Posted February 9 (edited) Rename your AndroidManifest.tempate.xml to .old and do the same for other *tempate* files there (there are for Windows and iOS too) Rebuild for the target platform Deploy again from Project menu then compare the .old files with the new ones created and see if you had any custom changes to the old tempates that you may wish to copy/adapt into the new ones (as said above can't go below Android SDK 21 for min target [haven't checked myself] though if you wanted to target much older devices [could build with older Delphi for them and deploy as .apk for sideloading]) update: maybe you can have min version <21 too with use of a library, see https://developer.android.com/build/multidex#mdex-gradle - not sure how easy is to adapt those instructions for Delphi though if you change the templates try build+deploy again Edited February 9 by George Birbilis Share this post Link to post