Ney Correa
Ney Correa

Reputation: 11

Error compiling code for Android in Delphi

When I try to compile code for Android in Delphi, it shows this error:

[PAClient Error] Error: E7688 Unable to execute '"C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot\bin\java.exe" -cp "c:\program files (x86)\embarcadero\studio\22.0\bin\Android\r8-3.3.28.jar" com.android.tools.r8.D8 --release --min-api 23 --output "C:\Users\PC-Ney\Downloads\utils\Examples\Delphi\Android\Storage\Android\Debug\Storage.classes" @"C:\Users\PC-Ney\Downloads\utils\Examples\Delphi\Android\Storage\Android\Debug\dex_list.txt"' (Error 1)

I haven't found a solution for this.

I already tried using another SDK, but I was unsuccessful.

Upvotes: 1

Views: 1741

Answers (3)

Matthew Muller
Matthew Muller

Reputation: 333

In the Delphi editor, go to the Projects panel (on the right) and right click the Android platforms under Target Platforms and go to Edit SDK. From there, pick the Java property and change the jdk-X.X.X.X-hotspot folder name to the one that's included in your C:\Program Files\Eclipse Adoptium directory. Be sure to do this for both 64-bit and 32-bit Android versions.

If you don't have jdk-X.X.X.X-hotspot in your C:\Program Files\Eclipse Adoptium directory, go to Tools → Manage Platforms, check under Additional Options that Eclipse Temurin OpenJDK XX (Hotspot) JVM is checked and click apply. It will download the JDK and then you'll need to complete the steps above.

Upvotes: 0

alvaroc
alvaroc

Reputation: 471

Completely ignore my previous "answer" Do this:

  1. Right click Target Platforms
  2. Right click Libraries
  3. Click Revert System Files to Default

After that, it should compile, link, merge, etc and deploy without error. The program I am migrating ran smoothly

Upvotes: 3

alvaroc
alvaroc

Reputation: 471

Hope this helps, since I used a previous version of Delphi (10.3)

  1. I copied dex_list.txt to say dex_list20.txt (20 is the directory where Delphi 10.3) is installed
  2. I replaced every instance of "22" with "20" so the files will refer to the Delphi 10.3 directory
  3. I used 7z to create a .7z file:
    7z a 22 @path_to_dex_list20.txt
  4. Now, this file contains the missing files but also some old files
  5. Expanded the file to
    C:\Program Files (x86)\Embarcadero\Studio\22.0\lib\android\debug
    be extra careful not to overwrite any file already present. Just in case, copy the directory or make a 7z file before.

After this, my app compiled but failed to deploy, some INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error but I guess that that has something to do with API version. I'm upgrading a 10.3 app to 11.1

Manually copying every nonexistent file should also work but I found this way more reliable.

Also, it's incredible, but many pages mention those Android Support Library files but not a single one stat how to get them. Google is making Android development more and more complex and less documented not to mention Embarcadero help, since my app, at first hand didn't even compile!

P.D. I don't know if there is a way to publish a file here or share it via some cloud storage link

Upvotes: 0

Related Questions