0

I have Delphi 10.4 with default Android SDK 25 installation (located C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.38860.1461) and Andoird NDK 21 installation (located C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidNDK-21-21.0.38860.1461\android-ndk-r21). One should take into account, that SDK and NDK locations are Delphi version specific and there is no indication that they are placed inside some special SDK or NDK roots.

As of 2022.12 Google Play requires all new Android apps to have Android SDK 31 targeting and that means that I should install Android SDK 31/NDK 25 on my computer and do integration inside Delphi 10.4 IDE.

I had to do manual SDK install. I have choosen D:\PlatformSDKs\android-sdk-windows as my sdk_root. I downloaded cmdline-tools from https://developer.android.com/studio "Command line tools only", unzipped and ran the installation command:

D:\cmdline-tools\bin>sdkmanager --sdk_root="D:\PlatformSDKs\android-sdk-windows"  "build-tools;33.0.1" "extras;google;usb_driver" "platforms;android-31" "tools"

It completed successfully. I went to https://github.com/android/ndk/wiki and downloaded android-ndk-r25b-windows.zip and unzipped as directory D:\PlatformSDKs\android-ndk-r25b.

After this I tried to integrate my SDK 31/NDK 25 as new target platform inside Delphi 10.4. IDE - there is wizard with multiple steps/forms for it.

But 2 forms from this wizard required me to provide specific directories/exe files from my new installations but I could not find anything resembling such artifcats inside my new installations.

There are those 2 forms:

The first problematic form required me to point to arm-linux-androideabi-ld.exe and arm-linux.androideabi-strip.exe locations but I could not find such artifacts, I just provided what I could find in my NDK installation. The following picutres show the empty paths and what I have put into them to enable furhter steps.

enter image description here

enter image description here

enter image description here

While I could fool the first problematic form in the wizard, the second problematic form appeared unsolvable:

enter image description here

It requred me to provide NDK API lcoation (e.g. NDK_BASE_PATH/platforms/android-23), but I had no platforms directory inside my D:\PlatformSDKs\android-ndk-r25b. I have no idea, why there is no such directory and how to get platforms directory with some platfrom (I guess 31 in my case)?

So - I had to abandond the SDK 31/NDK 25 integration inside my Delphi 10.4 for this time. But I am no seekd advice to to complete the integration? What other tools I have to install to fill the missing entries in Delphi 10.4 integration wizard?

Has anyone managed to install SDK 31/NDK 25 with Delphi 10.4 and what did you do?

Of course, I am aware of https://delphiworlds.com/2020/09/manual-android-sdk-ndk-install-delphi/ and http://delphi.org/2019/06/manually-installing-android-sdk-ndk-and-java-for-firemonkey-development/ but they are not mentioning that Delphi wizrd requires me to fill some entries for which there are no counterparts in SDK/NDK installation.

Maybe there are breaking changes that prohibits use of Anroid 31 from Delphi 10.4? Or maybe I can avoid using wizard for the registration and I can do the registration by manually editing Delpi keys in the Windows Registry. I guess - all the information about registered target platforms is saved inside Windows Registry?

Additional info (progress report): I followed the advice of Dalija Prasnikar and I have registered SDK 31 with the existing NDK 21. And now I am getting error message (essential content):

The command "D:\PlatformSDKs\android-sdk-windows\build-tools\33.0.1\dx.bat" --dex exited with code 9009

Indeed, there is no dx.bat in 33 build tools and this has been observed in Exited with code 9009 when building for Android already. Of course, the suggested change of d8.bat to dx.bat failed as mentioned there too.

That is one issue with SDK 31 / build tools 33. Another issue is the set of libraries, that appears in the command line options:

PATH... & "D:\PlatformSDKs\android-sdk-windows\build-tools\33.0.1\dx.bat" --dex --output="...\classes.dex" "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release\android-support-v4.dex.jar" "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release\cloud-messaging.dex.jar" "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release\fmx.dex.jar" "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release\google-play-billing.dex.jar" "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release\google-play-licensing.dex.jar" " exited with code 9009.

So, the automatically constructed command line takes some jars from "c:\program files (x86)\embarcadero\studio\21.0\lib\android\Release" and I am not sure whether they are or can be compatible with build tools 33.0 and SDK 31. They may be compatible, but I am not sure.

The references SO question stated, that command lines tools 30 could work, but I am not sure whether this is true for Delphi 10.4/Android 31 combination. I am considering a futher experiment.

TomR
  • 2,696
  • 6
  • 34
  • 87
  • 1
    Just use the NDK that you installed with Delphi in combination with SDK you have downloaded independently. NDK is not changing much, and Delphi distribution also has some files patched to work with it properly. – Dalija Prasnikar Dec 12 '22 at 08:24
  • 1
    I just looked a bit into it and Sydney only supports up to API 29. You will need Alexandria to support newer APIs. Generally, using newer SDK than the one version supports is not advisable because even if you can compile application, there may be incompatibilities on OS level and you are telling the OS you are supporting newer version, when actually you are not. When I looked at the question in the morning I was focusing on "How you can use external SDK" instead on "Can you use that SDK version at all". I should have caught that sooner, My apologies. – Dalija Prasnikar Dec 12 '22 at 09:28

0 Answers0