Jump to content
saeedbay

problem on update sdk ndk in delphi 11

Recommended Posts

im using delphi 11

default sdk ver is  25.2.5 and ndk is r21 

Before this, I have Android api 30(R) on delphi
But the program was frozen on mobile phones with Android 12 and above
I decided to define platform 33 in Delphi in a separate path
I changed the paths of the SDK Manager for the new Android
I did not succeed for NDK 25 because the new version of 25 does not have some files, for example, the path of the ld..exe or strip.exe or gdbserver file was not in the new version.
I had to leave the previous version of NDK
But apparently, Delphi still defines the target version as 30 in the Android manifest file
The first question is how to force Delphi to use platform 33 and the second question is how to define NDK 25.
Basically, what is the need for NDK?

sdk.jpg

Share this post


Link to post

in fact, the Android SDK/NDK is not installed, on exact word sense!

  • it is just "copyed" to your disk!

this said, you can copy from any other pc!!!

now, you can update it usando command line: skdmanager.bat is in "<<sdk root>>"\command-line\bin"

  • skdmanager.bat --sdk_root=<<Path root of your Android SDK>> "<< pacakge names to update or install"
    • --list <--- for all packages avaliable on Google)
    • --list_installed <--- for all packages installed in your computer
    • sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --list

for example: install/update/uninstall 2 packages named:  "build-tools;31.0.0" and "cmdline-tools;v5"

  • sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> "build-tools;31.0.0" "cmdline-tools;v5"
  • sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --update "build-tools;31.0.0" "cmdline-tools;v5"
  • sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --uninstall "build-tools;31.0.0" "cmdline-tools;v5"

you can download Android Studio if you dont have your NDK!!! 

later, just copy NDK folder for you disk (in any folder than desire) if you want uninstall Android Studio!!! because it's not necessary have it installed!

after this, just config your RAD IDE!!!

to updates your SDK/NDK just use the command-line above!

  • Like 1

Share this post


Link to post

In fact, I have already installed Android Studio and updated platform 33 through its SDK Manager, and then the same SDK path defined for Android Studio, which now contained new platforms, on IDE Delphi (SD window Delphi Manager) I set Delphi to call the SDK from that path
Actually, I did the update through Android Studio's SDK Manager and set the SDK path for Delphi and Android Studio to be the same.
Previously, I tried to introduce the new platform and the SDK path to Delphi from the Delphi SDK Manager window by pressing ADD button , but Delphi was not able to recognize the API level.

Share this post


Link to post

Thank you for your time

 

I updated the SDK from the command line and defined the path of platform 33 in the sdkmanager of Delphi editor, but in the
Androidmanifest.xml file, the "targetSdkVersion" is still on the number 30, which means the previous platform.

Share this post


Link to post
19 minutes ago, saeedbay said:
I updated the SDK from the command line and defined the path of platform 33 in the sdkmanager of Delphi editor, but in the
Androidmanifest.xml file, the "targetSdkVersion" is still on the number 30, which means the previous platform.

The targetSdkVersion value is whichever target API level Delphi currently supports, i.e. it is not determined by which API level you have selected. It should allow you to set this (see https://quality.embarcadero.com/browse/RSP-38976), however if you want it to be something different you'll need to change it in the AndroidManifest.template.xml file.

Share this post


Link to post

the SDK-values is see by Googe Play to filter apps for each Andoid version (smartphone O.S.), then, it can be installed. Or be: GooglePlay installed the app on Smartphone accord with values informed in Android Manifest!

But really, you can understand that the "minimun" required for your Android O.S. is "xxxxx", and the SDK "target" is used by Google!... "max" does not exists in fact!

Then if your Android O.S. needs "XX" as "minimum", then, dont worry about target (since you dont use functions restrict to "XX" version)!

 

you can "manually" change the AndroidManifest.template.xml" if want, but this dont do it "like an app totally supported by your Android O.S. / smartphone"

  • <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="33"/>
  • but if your smartphone Android "doesn't complain" ... use it ant see like all worlks!
Edited by programmerdelphi2k

Share this post


Link to post
18 hours ago, programmerdelphi2k said:

the SDK-values is see by Googe Play to filter apps for each Andoid version (smartphone O.S.), then, it can be installed. Or be: GooglePlay installed the app on Smartphone accord with values informed in Android Manifest!

But really, you can understand that the "minimun" required for your Android O.S. is "xxxxx", and the SDK "target" is used by Google!... "max" does not exists in fact!

Then if your Android O.S. needs "XX" as "minimum", then, dont worry about target (since you dont use functions restrict to "XX" version)!

 

you can "manually" change the AndroidManifest.template.xml" if want, but this dont do it "like an app totally supported by your Android O.S. / smartphone"

  • <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="33"/>
  • but if your smartphone Android "doesn't complain" ... use it ant see like all worlks!

hello again

According to your instructions, I set the android:targetSdkVersion to the number 33 and added  android:exported="true"  to the Androidmanifest file. The build program builds successfully, but when deployed and installed on a phone with Android 12, which I tested, Delphi issues an error message as follows. :

 

e1.jpg

Share this post


Link to post
4 minutes ago, saeedbay said:

you can "manually" change the AndroidManifest.template.xml" if want, but this dont do it "like an app totally supported by your Android O.S. / smartphone"

read my comment

Share this post


Link to post
14 hours ago, programmerdelphi2k said:

read my comment

With this situation, there is no guarantee that the program will work on the customer's phone, and no solution has been provided by Embarcadero, and this is unfortunately a big weakness.
I wonder if the rest of the developers don't have the same problem that their apps should work on new platforms

Share this post


Link to post
14 hours ago, saeedbay said:

an error message as follows. :

I doubt that error message (platform architecture issue) is related to the API level issue. It's possible that you're compiling for 64-bit and the installed OS is 32-bit. Be aware that some devices have a 64-bit CPU, but have a 32-bit Android OS installed.

  • Like 1

Share this post


Link to post

My problem is solved
I ran the program on Android 32 and it ran without errors
It was interesting to me that I tested the app on a Redmi a1+ with android 12 that has a 64-bit processor, but the Android 64 compilation didn't run on it, but 32-bit ran fine.

Share this post


Link to post
2 minutes ago, Dave Nottage said:

I doubt that error message (platform architecture issue) is related to the API level issue. It's possible that you're compiling for 64-bit and the installed OS is 32-bit. Be aware that some devices have a 64-bit CPU, but have a 32-bit Android OS installed.

thank u very much for your time

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×