Skip to main content

Android SDK Tools missing or fail to install during setup of RAD Studio

In some instances the installation of the required Android SDK tools (adb, platform files, api level etc) fail during the initial setup of the Android target in RAD Studio. Most commonly, the wrong JDK in available in JAVA_HOME environment variable or not installed at all.
The nature of how these external installation tools are invoked, do not provide feedback to the main RAD Studio setup and will thus fail silently, this will result in the IDE is unable to perform the build/deployment step when targeting Android.

For RAD Studio 12.1 and 12.2, JDK v17 is required.
You can use ninite.com to quickly select and install Adoptium JDK 17 x64, prior to running the RAD Studio setup.
To check if the correct JDK version is available in JAVA_HOME, open a command prompt and execute java --version if it returns a Java Runtime JDK version of 17.x or newer, you may proceed.

Another, but less common case, your enterprise environment (That is, your IT department) employs strong network security, including Deep Packet Inspection.
In short, the vendor of such a solution, pushes their own SSL certificate to clients, this allows them to intercept, decrypt and inspect https traffic - now, this causes problems for services which employs certificate pinning and verification of the certificate, something sdkmanager.bat does.

sdkmanager.bat is the command line utility google provides as part of their Android SDK package to install various api levels and other supporting tools used in the Android software development process.

 

To manually install the required Android tools and circumvent the SSL certificate issue, follow the steps below.

For RAD Studio 12.1 and 12.2

  1. Navigate to where your RAD Studio setup's global CatalogRepository folder is located.
    By default, the path is C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository

     

  2. Find the folder AndroidSDK-2525-xxxx where xxxx is the version number of RAD Studio
  3. Navigate to cmdline-tools\11.0\bin and open a command prompt in this folder
  4. Run the command sdkmanager.bat --update
    If it returns an error where the remote repositories can't be reached, we know it is something with the interception of https traffic.
  5. To install the platform, run the following command sdkmanager.bat --install "platforms;android-34" --no_https
    It is important to append the --no_https command line switch to force sdkmanager to download over http.

  6. To install the actual ADB tools, run the following command sdkmanager.bat --install "platform-tools" --no_https
    Again, remember to append the --no_https switch

Now the required packages from the Android SDK is installed, you can now proceed to open RAD Studio.
Go to Tools -> Options -> Deployment -> SDK Manager and verify the 32 and 64 Android SDKs do not have any exclamation marks next to the path selectors.
It is especially important to check the Java tab, and make sure keytool and jarsigner have fully qualified paths pointing to the currently installed Adoptium JDK 17.
Adjust accordingly and check the page both for 32 and 64 bit Android SDK!