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. Incorrect __ANDROID_API value when building QT from sources.
Forum Updated to NodeBB v4.3 + New Features

Incorrect __ANDROID_API value when building QT from sources.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
android
2 Posts 2 Posters 1.1k 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by
    #1

    I am building QT for Android on Windows with the following command file:

    set PATH=C:\PFiles\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%PATH%
    set PATH=%PATH%;C:\Program Files\Android\Android Studio\jre\bin
    set PATH=%PATH%;C:\PFiles\Python35 
     
    rem Check if the tools are in PATH
    where gcc
    where mingw32-make.exe
    where perl.exe
    where javac.exe
     
    set "ANDROID_TARGET_ARCH=armeabi-v7a"
    rem see ANDROID_SDK_ROOT\build-tools\ folder
    set "ANDROID_BUILD_TOOLS_REVISION=27.0.3"
    rem The same values as in QT Creator:
    set "ANDROID_API_VERSION=android-19"
    set "ANDROID_SDK_ROOT=C:\Users\D-Ef\AppData\Local\Android\Sdk"
    set "ANDROID_NDK_PATH=C:\Users\D-Ef\AppData\Local\Android\Sdk\ndk-bundle"
    set "ANDROID_TOOLCHAIN_VERSION=4.9"
    set "ANDROID_NDK_HOST=windows-x86_64"
     
    configure.bat -prefix C:\Qt\Qt5.11-Android -release -force-debug-info -platform win32-g++ -opengl es2 -xplatform android-g++ -android-ndk %ANDROID_NDK_PATH% -android-sdk %ANDROID_SDK_ROOT% -opensource -confirm-license -nomake tests -nomake examples -skip qtserialport -skip qtquick1 -skip webengine -skip websockets -skip webchannel -skip qt3d -skip charts -skip connectivity -skip datavis3d -skip doc -skip gamepad -skip location -skip sensors -skip serialbus -skip purchasing -skip wayland
    rem mingw32-make.exe -j2
    

    where I set Android API level to 19, but there is -D__ANDROID_API__=16 in the compiler command line

    Android\Sdk\ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=16 ...
    
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You need to set ANDROID_NDK_PLATFORM=android-19 to set the NDK definition correctly. The ANDROID_API_VERSION is for the SDK.

      (Z(:^

      1 Reply Last reply
      1

      • Login

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