Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cross-compile application for Android and generate apk from command line
Forum Updated to NodeBB v4.3 + New Features

Cross-compile application for Android and generate apk from command line

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 358 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cristeab
    wrote on last edited by
    #1

    Hi
    I am trying to cross-compile an apk for Android on macOS using Qt5.15.2 with cmake.
    While Android NDK has support for cross-compiling with cmake, androiddeployqt is not able to generate correctly the apk file. The custom target used to generate the apk is shown below:

    add_custom_target(pack COMMAND ${androiddeployqt_ROOT_PATH}/bin/androiddeployqt
               --input android_deployment_settings.json
               --output ${CMAKE_BINARY_DIR}/android-build
               --android-platform android-21
               --gradle
               --release
               --sign ${STORE_FILENAME} ${STORE_USERNAME}
               --storepass ${STORE_PASSWORD})
    

    But it exists with error because it cannot find zipalign.

    I was able to generate the apk, after changing this file
    ~/Qt/5.15.2/android/lib/cmake/Qt5Core/Qt5AndroidSupport.cmake
    such that sdkBuildToolsRevision is defined as
    "sdkBuildToolsRevision": "21.1.1",
    In this way zipalign is found by androiddeployqt.

    However, I still need to configure AndroidManifest.xml.
    So my question is how can I specify a custom AndroidManifest.xml file to be used by androiddeployqt ? Previously, with qmake, there was a way to specify a folder where AndroidManifest.xml could be put, ANDROID_PACKAGE_SOURCE_DIR, but I don't know how to do the same in cmake.

    thank you
    Bogdan

    1 Reply Last reply
    1
    • C Offline
      C Offline
      cristeab
      wrote on last edited by
      #2

      I have created a bug report here: https://bugreports.qt.io/browse/QTBUG-93372

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved