<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[&quot;No target architecture defined in json file&quot; error while building for Android]]></title><description><![CDATA[<p dir="auto">I have app app that successfully builds for Android and has</p>
<pre><code>android {
       ANDROID_PACKAGE_SOURCE_DIR = $$PWD/platform/android
}
</code></pre>
<p dir="auto">in its .pro file.</p>
<p dir="auto">But the same directive does not work with CMake:</p>
<pre><code>if(ANDROID)
    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/platform/android")
endif()
</code></pre>
<p dir="auto">when I compile the app for Android I get:</p>
<pre><code>03:11:38: Running steps for project MyAppQt...
03:11:38: Starting: "E:\PFiles\cmake-3.19.1-win64-x64\bin\cmake.exe" --build E:/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_2_0_android_Clang_x86_64-Debug --target all
jom: parallel job execution disabled for Makefile
[  2%] Built target MyAppQt_lrelease
[  3%] Automatic MOC and UIC for target MyAppQt
[  3%] Built target MyAppQt_autogen
[100%] Built target MyAppQt
03:11:39: The process "E:\PFiles\cmake-3.19.1-win64-x64\bin\cmake.exe" exited normally.
03:11:39: Starting: "E:\Qt\Qt6.2\windows\bin\androiddeployqt.exe" --input E:/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_2_0_android_Clang_x86_64-Debug/android-MyAppQt-deployment-settings.json --output E:/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_2_0_android_Clang_x86_64-Debug/android-build --android-platform android-30 --jdk "C:/Program Files/Java/jdk-11.0.11" --gradle
No target architecture defined in json file.
03:11:39: The process "E:\Qt\Qt6.2\windows\bin\androiddeployqt.exe" exited with code 2.
Error while building/deploying project MyAppQt (kit: Android Qt 6.2.0 (android) Clang x86_64)
When executing step "Build Android APK"
03:11:39: Elapsed time: 00:01.
</code></pre>
<p dir="auto">In <code>android-LinesGameQt-deployment-settings.json</code> I have this:</p>
<pre><code>{
    "_description": "This file is generated by QtCreator to be read by androiddeployqt and should not be modified by hand.",
    "application-binary": "E:/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_2_0_android_Clang_x86_64-Debug/libMyAppQt.so",
    "ndk": "C:/Users/D-Ef/AppData/Local/Android/Sdk/ndk/21.3.6528147",
    "ndk-host": "windows-x86_64",
    "qml-root-path": "E:/repos/examples/src/MyApp/MyAppQt",
    "qt": "E:/Qt/Qt6.2/android",
    "sdk": "C:/Users/D-Ef/AppData/Local/Android/Sdk",
    "stdcpp-path": "C:/Users/D-Ef/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so",
    "target-architecture": "x86_64",
    "tool-prefix": "llvm",
    "toolchain-prefix": "llvm",
    "useLLVM": true
}
</code></pre>
<p dir="auto">With .pro file <code>android-LinesGameQt-deployment-settings.json</code>  looks different and has <code>architectures</code> but not  <code>target-architecture</code>:</p>
<pre><code>{
   "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
   "qt": "E:/Qt/Qt6.2/android",
   "sdk": "C:/Users/D-Ef/AppData/Local/Android/Sdk",
   "sdkBuildToolsRevision": "30.0.3",
   "ndk": "C:/Users/D-Ef/AppData/Local/Android/Sdk/ndk/21.3.6528147",
   "toolchain-prefix": "llvm",
   "tool-prefix": "llvm",
   "ndk-host": "windows-x86_64",
   "architectures": {"x86_64":"x86_64-linux-android"},
   "android-package-source-directory": "E:/repos/examples/src/MyApp/MyAppQt/platform/android",
   "android-min-sdk-version": "23",
   "android-target-sdk-version": "30",
   "qml-importscanner-binary": "E:/Qt/Qt6.2/windows/bin/qmlimportscanner",
   "rcc-binary": "E:/Qt/Qt6.2/windows/bin/rcc",
   "qml-root-path": "E:/repos/examples/src/MyApp/MyAppQt",
   "stdcpp-path": "C:/Users/D-Ef/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib",
   "qrcFiles": "E:/repos/examples/src/MyApp/MyAppQt/qml.qrc,E:/repos/examples/src/MyApp/MyAppQt/scene.qrc,E:/repos/examples/src/MyApp/MyAppQt/icons.qrc,E:/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_2_0_android_Clang_x86_64-Debug/x86_64/qmake_qmake_immediate.qrc",
   "application-binary": "MyAppQt"
}
</code></pre>
<p dir="auto">My QT version is 6.2.<br />
OS: Windows</p>
<p dir="auto">see also <a href="https://forum.qt.io/topic/110544/no-target-architecture-defined-in-json-file-using-cmake-compile-for-android">https://forum.qt.io/topic/110544/no-target-architecture-defined-in-json-file-using-cmake-compile-for-android</a></p>
]]></description><link>https://forum.qt.io/topic/132550/no-target-architecture-defined-in-json-file-error-while-building-for-android</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 16:25:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/132550.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Dec 2021 00:23:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;No target architecture defined in json file&quot; error while building for Android on Tue, 18 Jan 2022 19:53:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dmitriano">@<bdi>Dmitriano</bdi></a> How did you update the <code>build.gradle</code></p>
]]></description><link>https://forum.qt.io/post/699138</link><guid isPermaLink="true">https://forum.qt.io/post/699138</guid><dc:creator><![CDATA[AkshayFP]]></dc:creator><pubDate>Tue, 18 Jan 2022 19:53:33 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;No target architecture defined in json file&quot; error while building for Android on Sun, 12 Dec 2021 12:45:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dmitriano">@<bdi>Dmitriano</bdi></a> this probably started to work when I updated <code>build.gradle</code>.</p>
]]></description><link>https://forum.qt.io/post/694414</link><guid isPermaLink="true">https://forum.qt.io/post/694414</guid><dc:creator><![CDATA[Dmitriano]]></dc:creator><pubDate>Sun, 12 Dec 2021 12:45:43 GMT</pubDate></item></channel></rss>