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. No target architecture defined in json file using cmake compile for Android

No target architecture defined in json file using cmake compile for Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 2.8k Views
  • 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.
  • B Offline
    B Offline
    Ben Hoff
    wrote on last edited by Ben Hoff
    #1

    Hey I'm trying to compile an app for android using cmake. When I push the build button, the android_deployment_settings.json file that is produced looks like as follows.

    {
        "_description": "This file is generated by QtCreator to be read by androiddeployqt and should not be modified by hand.",
        "application-binary": "libmicrophone-app.so",
        "architectures": {
        },
        "ndk": "/Users/hoff/Library/Android/sdk/ndk/20.1.5948944",
        "ndk-host": "darwin-x86_64",
        "qml-root-path": "/Users/hoff/swdev/microphone-app",
        "qt": "/Users/hoff/Qt/5.12.6/android_x86",
        "sdk": "/Users/hoff/Library/Android/sdk",
        "stdcpp-path": "/Users/hoff/Library/Android/sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/",
        "tool-prefix": "llvm",
        "toolchain-prefix": "llvm",
        "useLLVM": true
    }
    

    Then I get an error, No target architecture defined in json file.

    Which makes sense, there is no architecture defined. Looking at another project, the json file looks different.

    Other non-related project using qmake:

    {
       "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
       "qt": "/Users/hoff/Qt/5.12.6/android_x86",
       "sdk": "/Users/hoff/Library/Android/sdk",
       "sdkBuildToolsRevision": "29.0.2",
       "ndk": "/Users/hoff/Library/Android/sdk/ndk/20.1.5948944",
       "toolchain-prefix": "llvm",
       "tool-prefix": "llvm",
       "toolchain-version": "4.9",
       "ndk-host": "darwin-x86_64",
       "target-architecture": "x86",
       "qml-root-path": "/Users/hoff/Qt/Examples/Qt-5.12.6/location/mapviewer",
       "stdcpp-path": "/Users/hoff/Library/Android/sdk/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so",
       "useLLVM": true,
       "application-binary": "/Users/hoff/Qt/Examples/Qt-5.12.6/location/build-mapviewer-Android_for_x86_Clang_Qt_5_12_6_for_Android_x86-Debug/libqml_location_mapviewer.so"
    }
    

    You can see the target_architecture is set.

    So how do I define the target architecture of x86 for my cmake build?

    1 Reply Last reply
    1
    • B Offline
      B Offline
      Ben Hoff
      wrote on last edited by
      #2

      Looks like by this blog that qt just isn't producing the correct android_deployment_settings.json

      https://martin.rpdev.net/2018/08/04/building-android-projects-with-qt-creator-and-cmake.html

      Might have to do it manually for now.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        seijikun
        wrote on last edited by seijikun
        #3

        I am currently having the same problem. This worked not too long ago though.
        Also interesting:
        When QtCreator runs the androiddeployqt executable, the error is a different one: "Cannot find application binary libTestApp.so"

        However, when I manually execute everything the way QtCreator does it (at least the way it shows it in [4 Compile Output]), I get the mentioned "No target architecture defined in json file" error.

        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