Unable to Export Android App

Does anyone know this error. it shows when exporting the project to android

Building Android app
{"cookie":"","inReplyTo":"configure","message":"CMake Error: CMake was unable to find a build program corresponding to \"Ninja\".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.","title":"Error","type":"message"}
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
Configuration failed.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
> com.android.ide.common.process.ProcessException: Error configuring

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s



(unknown): E0200: Android build failed

fuse: Errors were encountered while building the project
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:copySharedLibraries UP-TO-DATE
:app:generateJsonModelDebug
External native generate JSON debug: starting JSON generation
External native generate JSON debug: using platform version 16 for ABI ARMEABI_V7A and min SDK version 16
External native generate JSON debug: rebuilding JSON C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a\android_gradle_build.json due to:
External native generate JSON debug: - expected json C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a\android_gradle_build.json file is not present, will remove stale json folder
External native generate JSON debug: - missing previous command file C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_build_command.txt, will remove stale json folder
External native generate JSON debug: removing stale contents from 'C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a'
External native generate JSON debug: created folder 'C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a'
External native generate JSON debug: executing cmake Executable : C:\Users\admin\AppData\Local\Android\sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments : 
-HC:\Users\admin\Desktop\Test Build\build\Android\Debug\app\src\main
-BC:\Users\admin\Desktop\Test Build\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-16
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\admin\Desktop\Test Build\build\Android\Debug\app\build\intermediates\cmake\debug\obj\armeabi-v7a
-DCMAKE_BUILD_TYPE=Debug
-DANDROID_NDK=C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
-DCMAKE_SYSTEM_VERSION=16
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_ANDROID_NDK=C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle
-DCMAKE_TOOLCHAIN_FILE=C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle\build\cmake\android.toolchain.cmake
-G Ninja
-DCMAKE_BUILD_TYPE=Release
-DANDROID_STL=c++_static
-DANDROID_PLATFORM=android-16
-DANDROID_TOOLCHAIN=clang
-DANDROID_NDK=C:/Users/admin/AppData/Local/Android/sdk/ndk-bundle
jvmArgs : 




[== "CMake Server" ==[

{"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}

]== "CMake Server" ==]

[== "CMake Server" ==[

{
  "type": "handshake",
  "cookie": "gradle-cmake-cookie",
  "protocolVersion": {
    "isExperimental": true,
    "major": 1,
    "minor": 1
  },
  "sourceDirectory": "C:/Users/admin/Desktop/Test Build/build/Android/Debug/app/src/main",
  "buildDirectory": "C:/Users/admin/Desktop/Test Build/build/Android/Debug/app/.externalNativeBuild/cmake/debug/armeabi-v7a",
  "generator": "Ninja"
}

]== "CMake Server" ==]



[== "CMake Server" ==[

{"cookie":"gradle-cmake-cookie","inReplyTo":"handshake","type":"reply"}

]== "CMake Server" ==]

[== "CMake Server" ==[

{
  "type": "configure",
  "cacheArguments": [
    "",
    "-DANDROID_ABI\u003darmeabi-v7a",
    "-DANDROID_PLATFORM\u003dandroid-16",
    "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY\u003dC:\\Users\\admin\\Desktop\\Test Build\\build\\Android\\Debug\\app\\build\\intermediates\\cmake\\debug\\obj\\armeabi-v7a",
    "-DCMAKE_BUILD_TYPE\u003dDebug",
    "-DANDROID_NDK\u003dC:\\Users\\admin\\AppData\\Local\\Android\\sdk\\ndk-bundle",
    "-DCMAKE_SYSTEM_NAME\u003dAndroid",
    "-DCMAKE_ANDROID_ARCH_ABI\u003darmeabi-v7a",
    "-DCMAKE_SYSTEM_VERSION\u003d16",
    "-DCMAKE_EXPORT_COMPILE_COMMANDS\u003dON",
    "-DCMAKE_ANDROID_NDK\u003dC:\\Users\\admin\\AppData\\Local\\Android\\sdk\\ndk-bundle",
    "-DCMAKE_TOOLCHAIN_FILE\u003dC:\\Users\\admin\\AppData\\Local\\Android\\sdk\\ndk-bundle\\build\\cmake\\android.toolchain.cmake",
    "-G Ninja",
    "-DCMAKE_BUILD_TYPE\u003dRelease",
    "-DANDROID_STL\u003dc++_static",
    "-DANDROID_PLATFORM\u003dandroid-16",
    "-DANDROID_TOOLCHAIN\u003dclang",
    "-DANDROID_NDK\u003dC:/Users/admin/AppData/Local/Android/sdk/ndk-bundle"
  ]
}

]== "CMake Server" ==]



[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","message":"CMake Error: CMake was unable to find a build program corresponding to \"Ninja\".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.","title":"Error","type":"message"}

]== "CMake Server" ==]



[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","progressCurrent":1000,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}

]== "CMake Server" ==]



[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","message":"Configuring incomplete, errors occurred!\nSee also \"C:/Users/admin/Desktop/Test Build/build/Android/Debug/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log\".","type":"message"}

]== "CMake Server" ==]

Configuring incomplete, errors occurred!
See also "C:/Users/admin/Desktop/Test Build/build/Android/Debug/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
Configuring incomplete, errors occurred!
See also "C:/Users/admin/Desktop/Test Build/build/Android/Debug/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".


[== "CMake Server" ==[

{"cookie":"","errorMessage":"Configuration failed.","inReplyTo":"configure","type":"error"}

]== "CMake Server" ==]

External native generate JSON debug: JSON generation completed with problems
:app:generateJsonModelDebug FAILED
16 actionable tasks: 1 executed, 15 up-to-date
5.49 s

try installing this ninja command line : https://github.com/ninja-build/ninja/releases

Iv’e downloaded the Ninja and it has only one file which is Ninja.exe when trying to run. it just opens cmd and closes it. don’t know what to do with this.

…and for Mac users: if ninja doesn’t want to install due to a 404, its because your brew needs to be updated; ninja probably checks brew and or OS versions.

I’d love to help ya but I don’t have access to a windows machine at the moment :scream_cat:

…have you tried this? https://github.com/rwols/CMakeBuilder/wiki/Ninja-for-Windows-Installation-Instructions

Will check on this. Thank you very much. Hope this will help me. :slight_smile:

Current Uno v1.12 works with CMake 3.6.4111459, but has the problem you’re describing when trying to build using newer CMake. From your log it looks like you’re building using a newer CMake.

To fix this you can either,

  1. Add ninja.exe to PATH. It’s included in Android CMake and the location is likely %LOCALAPPDATA%\Android\sdk\cmake\3.10.2.4988404\bin.
  2. Or, make sure you only have CMake 3.6.4111459 installed. 3.6.4111459 should be the only sub-directory found under %LOCALAPPDATA%\Android\sdk\cmake.

The upcoming Uno v1.13 will work with the new CMake version out-of-the-box, and will be released in about two weeks I think.

Hi Mortend,
i had ninja.exe already in the following PATH %LOCALAPPDATA%\Android\sdk\cmake\3.10.2.4988404\bin


before that error

Blockquote

Your files look good.

You can add %LOCALAPPDATA%\Android\sdk\cmake\3.10.2.4988404\bin to your PATH, as explained here https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/