[OLD] QT Herelink Setup
(This was tested on Ubuntu 20.04)
Clone this repository: https://github.com/Inspired-Flight-Technologies/qgroundcontrol-herelink
Install QT Creator
You are going to need to install QT creator. Unfortunutely, the most recent version does not work with QT 5.12.6, which is what QT herelink supports.
To install the correct version of QT Creator, first go to this link: https://download.qt.io/archive/qt/5.12/5.12.6/ - Download "qt-opensource-linux-x64-5.12.6.run".
Now you will need to run the installer. In a terminal, go to where you installed "qt-opensource-linux-x64-5.12.6.run". You need to first change the permissions of the file so that you can execute it. Do:
chmod +x qt-opensource-linux-x64-5.12.6.runNow that the file is executable. We can run it. Do:
./qt-opensource-linux-x64-5.12.6.run
An installer will pop up. Log into your QT account.
Hit next:
Select these components:
Accept the license agreement and hit install.
This will both install QT 5.12.6 and a compatable version of QT creator onto your system. After it is done installing, to verify that QT creator has installed, you can search for it in your Ubuntu applications

Install OpenJDK
Use this command to install JDK 8:
Install Android Studio
The guide linked at the top has you install android studio as a zipped file, but it is much easier to just install it through the command line. First, import the android studio repository by typing the command below:
Update your system and then install Android Studio:
Now, search up Android Studio in your applications, and complete the install there:

Install Necessary Sdk Packages On Android Studio
Open up Android Studio and click on "More Actions". Then click "SDK Manager".

Make sure to select "Show package details" at the bottom.
Select these SDK platforms: 1. Select SDK platform 29 and the ARM 64 v8a System Image for it (check show package details to see this)
Android SDK platform 33, Android SDK platform 32, Android SDK platform 31
Select these SDK Tools:
Android SDK Build-Tools: Version 25.0.3 (If SDK build tools 33.0.2 is installed, make sure to uncheck it so that it uninstalls)
NDK version 20.0.5594570
Android SDK Command-line Tools: Version 7.0
Android Emulator
Android SDK Platform-Tools
Android SDK Tools (Obsolete) {Make sure "Hide Obsolete Packages" is unchecked}
Cick "Apply" and "Ok"
Setup QT For Android
Open up QT Creator.
Go to Tools->Options
Click on "Devices" and select the "Android" tab
For "JDK Location" set the location to openjdk-8. If you installed it via apt, it should be: /usr/lib/jvm/java-1.8.0-openjdk-amd64 If JDK location is automatically set to that already, you don't need to change it.
For "SDK Location", set it to your Android sdk location. It should normally exist in your /home/user/Android folder. For me it is /home/john/Android/Sdk Make sure to replace "john" with your username.

For "NDK Location" go to the ndk folder of the sdk location and select 20.0.5594570

IMPORTANT: Under the "SDK Manager" tab, under "Tools" select install for "Android Support Repository". This package is a necessity, and is not installable from Android Studio.

Note: It will ask you to agree to license agreement before installing
At the end, it should look something like this:

Make sure to hit "Apply" when you are done making changes.
GStreamer Setup
If you were to configure your project and build right now, you would run into a gstreamer error. To fix this, you need to download gstreamer-1.0-android-universal-1.14.4.tar.bz2 here. Next, extract this zip file into a folder with the same name as the zip but without the .tar.bz2: To do this, navigate to where gstreamer-1.0-android-universal-1.14.4.tar.bz2 is located. By default it should have downloaded to your Downloads directory.
Next, let's make the directory where you will zip the contents of the zip file into:
Next, let's unzip the tar.bz2 file into that directory we made:
The structure after extracting the archive and moving it into qgroundcontrol-herelink-ift should look like this:

Configuring Project
You must now configure the project. Go to 'File', 'Open file or project', and select qgroundcontrol.pro in the 'qgroundcontrol-herelink-ift' directory. Next, select what you want to build for. I chose Android for arm64-v8a. Click "Configure Project"

Wait a moment for it to read project. Then the hammer button should become available.
Building for Herelink
Click on the Hammer button to build. Building should take a pretty long time the first time around. Around 5-20 minutes depending on how fast your computer is.
If you make changes to the build process itself, you may need to rebuild from scratch. In that situation, you would right click the "qgroundcontrol" project under "projects" and hit "rebuild".
Last updated