10.3 Rio’s installer (I use and recommend the EXE/web over the ISO, since it is faster and more flexible) does a fantastic job of installing and setting everything up for Android development, without requiring any manual steps. Still, sometimes it is nice to be able to manually install everything, which brings me to this guide.
I’m a big believer in understanding the way the underlying systems work, and installing this way is more work, but you are able to see how everything works together. Also, this allows you to share SDKs between multiple installations, and also place the tools like ADB on your path for easy use. Not to say you can’t do all of that with the automatic install, but sometimes it is nice to get your hands dirty.
I also occasionally run into people who are having trouble getting things installed for various reasons. So this is a great way to troubleshoot installation issues.
This assumes you already have RAD Studio, Delphi, or C++Builder 10.3 Rio already installed. 10.3 Rio changed the versions of the SDK and NDK that it uses, so this guide won’t work with other versions. Also, I switched to AdoptOpenJDK instead of the traditional Oracle JDK. I’ll show you how to install that here, but if you use a different JDK that will be different for you.
OpenJDK is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License version 2 with a linking exception. It is the official reference implementation of Java SE since version 7.
There are multiple builds available, with different terms and support options. Why not just use the Java SE JDK? Oracle has changed the license on it that may require you to purchase a license to use it. For my purposes it is better save than sorry, plus the OpenJDK is a lot smaller and less annoying. I picked AdoptOpenJDK, which seems to be the most popular option, but this should mostly work the same with any build.
AdoptOpenJDK includes the JRE (Java Runtime Environment) too, so just one install. You must install it first because you can’t run the Android SDK manager without Java installed, and the IDE users the JDK for KeyTool and JarSigner.
AdoptOpenJDK Install Instructions
Download the Windows installer for OpenJDK 8 (LTS). I used the 64-bit Windows version with the HotSpot JVM, and then just run the installation. Be sure to tell it to set the JAVA_HOME environment variable.
- Windows 64-bit OpenJDK 8 (LTS) with HotSpot JVM
- 90.2 MB (94,650,368 bytes)
- SHA256 22303C8338C8015BA34B21829706C1231DD966BD84372CE0DE944C848BB13C52
Installing the Android SDK
When you visit the site to download the Android SDK they try to get you to download the full Android Studio, but you don’t need all of that. If you scroll to the bottom, you will see the “Command line tools only” downloads. One note, the downloads listed on the site no longer include the GUI SDK Manager. If you scroll down further, I’ll show you how you can download that and use it instead.
Command-Line Only install
- Windows Platform SDK
- 148 MB (156,136,858 bytes)
- SHA256 7e81d69c303e47a4f0e748a6352d85cd0c8fd90a5a95ae4e076b5e5f960d3c7a
This isn’t an installer, so just pick a folder to unzip it into. You will just find a “tools” folder in the zip. This contains the SDK Manager to install the rest of the Android SDK. I typically unzip it into the folder:
Then use the sdkmanager command-line tool (in the tools\bin folder) to install everything you need. Notice I am installing the Android 26 Platform. This is the version you want to use with 10.3 Rio. It meets the new Target SDK requirements and still gives your Android apps maximum compatibility. This is the version 10.3 Rio is designed to work with.
sdkmanager "build-tools;29.0.0" "extras;google;usb_driver" "platforms;android-26" "tools" "platform-tools"
Android SDK with GUI Install
For some reason the Android SDK GUI Installer isn’t listed for download, but the file is still available on their servers.
- Android SDK release 25.2.5 (this is the version RAD Studio installs, and the last version with the GUI)
- 292 MB (306,785,944 bytes)
- SHA256 DA1A0BD9BB358CB52A8FC0A553A060428EFE11151E69B9EA7A5CBACB27CF1C7C
The fact we are installing an older version of the SDK isn’t a big deal because we will still update it when we are done, but now we have a choice of using the command-line interface like I showed in the previous section, or using the GUI SDK Manager by running the Android.bat file in the tools folder.
Once you run the SDK manager, you want to install the latest Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools, Android API 26 SDK Platform, and the Google USB Driver. It will default to installing a lot of other things you don’t need. Feel free to deselect those. The Google USB Driver isn’t technically needed, but is nice to have.
Once you’ve selected what you want installed, you can always update them via the command line with the sdkmanager utility in the tools\bin folder
Installing the Android NDK
10.3 Rio updated the version of the Android NDK it uses to release 17b. It was the latest at the time of Rio’s development. There have been some new NDK releases since then. If you visit the Older Releases page for the Android NDK you will see 17b isn’t listed there, but the download file is still available. 17c may work, but I haven’t tested it extensively yet.
- Windows 32-bit version 17b
- 580 MB (608,351,759 bytes)
- SHA256 4F6128AE1D6382A783EF6C8B836E8DA94B81AA490DC83DDCD2788BFE27E40A53
The NDK is also a zip file, so just extract it to the folder of your choosing. I’ll extract it next to my Android SDK. The root folder in the zip file is “android-ndk-r17b”
There are no further installation steps necessary. Your folders should look something like this when you are done:
I’ve expanded the directories so you can see the build tools and Android platforms also installed
Environment Variables and System Path
Last thing you need to do is set up some Environment Variables and add things to your system path. This isn’t strictly necessary, but I highly recommend it!
Then add the following to your system path
- %JAVA_HOME%\bin (you can replace the expanded version with this)
Settings Up the IDE SDK Manager
Since we’ve installed the SDK manually, we need to tell the IDE where to find it. This is really simple. Go into Tools ? Options ? Deployment ? SDK Manager (or just use the IDE search for SDK Manager) and add a new SDK entry.
The next stage in the wizard looks to make sure it can find everything it needs. If you didn’t install everything with the Android SDK Manager, then you may see a warning symbol next to something. If that is the case go back and double check the installation.
And with that you are ready to develop and deploy Android apps with FireMonkey.
2 replies on “Manually Installing Android SDK, NDK, and Java for FireMonkey Development”
article helped me a lot, thank you very much
[…] Vor 10.4 sollte JDK 1.8_60 sein, danach besser AdoptOpenJDK verwenden. Ist hier auch beschrieben. http://delphi.org/2019/06/manually-i…y-development/ Das wird aber normalerweise alles richtig installiert, vielleicht ist bei der Installation was […]