Android Build Setup for KStars

Madhav [kawagucci] madhavgrimm at gmail.com
Sat Mar 25 16:36:51 GMT 2023


Hey,

If anyone is willing to fix the kstars_lite build for android and is stuck
with setting android sdk/ndk and qt for android, this guide should help you
get started quickly.

Setup for..

*1. Qt Creator*

Qt Creator must be installed via the Qt Online Installer (gui) and not the
system package manager (uninstall that  first).
In that installer, Select the right Qt5 version according to kstars min
version. Under the same select Desktop and Android. This will correctly
setup qt creator and set the paths for Qt5 Android and Desktop
automatically.

*2. Android SDK and Android NDK*
There is no need to install via sdkmanager or your system package manager.
Qt Creator comes with a  tool (which inherently uses sdkmanager) to
automatically install it.
Edit > Preferences > Devices > Android, select a folder, click on set up
Sdk Manager.
This will set up the Android SDK and NDK, with green ticks following in
that dialog box. Optionally select the OpenSSL also.
To install android system images for debugging, select SDK Manager again

*3. CMake Config*
Tick BUILD_KSTARS_LITE in Qt Creator Cmake Config. In the CMakeLists.txt
file, add the following

if(BUILD_KSTARS_LITE)
    add_definitions(-DKSTARS_LITE=1)
endif()

at around line 95, where find_package(qt5 is called)
find_package(Qt5DBus REQUIRED) must also be added.

*4. Build*

Now on building (for desktop) , there will be a bunch of errors, fixing
these errors and proceeding to android build would be the right way.

I was mostly stuck getting the build environment right. Also, From android
API 27 (Oreo), we can't have AVDs and I'm not sure how to debug correctly
with newer Android versions.

Best Regards,
Madhav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20230325/8f360fc8/attachment.htm>


More information about the kde-devel mailing list