Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Creator cmake project add application icon to Android application



  • I am developing an Android app using a cmake project created with Qt Creator. The application builds and runs fine on the target device (arm64-v8a). However the application uses the android standard application icon.

    I tried the following:
    I created a AndroidManifest.xml under Projects -> Build -> Build Android APK -> Create Templates. In the AndroidManifest.xml I chose my own icon. The AndroidManifest.xml together withg gradle files is saved in my project folder under android (e.g. android/AndroidManifest.xml). Furthermore I added it to the library in the CMakeLists.txt:

    set(ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android)
    add_library(Test SHARED
          android/AndroidManifest.xml
          main.cpp
          qml.qrc
          ${TS_FILES}
    )
    

    However, the application icon does not change when the app is deployed on the phone (still uses the default android icon).

    How can I use a custom application icon (e.g. a .png image) using Qt Creator and cmake?

    I am using Qt 5.14.0 and Qt Creator 4.11.1.