Failed to parse Android NDK revision

My Android preview build fails with “Failed to parse Android NDK revision”. Any ideas?

Fuse 1.8.1 (build 15610)
Starting preview for //Users/mattitihverainen/Fuse/Example/Example.unoproj, target Android
Configuring  1.79 s
Compiling syntax tree  1.51 s
Generating code and dataFontconfig warning: no <cachedir> elements found. Check configuration.
Fontconfig warning: adding <cachedir>~/Library/Caches/com.xamarin.fontconfig</cachedir>
Fontconfig warning: adding <cachedir prefix="xdg">fontconfig</cachedir>
  5.99 s
Building Android app
/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/src/main/AndroidManifest.xml:83:9-122 Warning:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
CMake Warning at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:63 (message):
  Using custom NDK path (ANDROID_NDK is set):
  /Users/mattitihverainen/Library/Android/sdk/ndk-bundle
Call Stack (most recent call first):
  /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:2 (project)


CMake Error at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:72 (message):
  Failed to parse Android NDK revision:
  /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/source.properties.

  ### Android Tool: Source of this archive.

  #Tue Mar 13 16:26:33 EET 2018

  Archive.HostBits=64

  Archive.HostOs=macosx

  Pkg.Desc=NDK

  Pkg.LicenseRef=android-sdk-license

  Pkg.Revision=16

  Pkg.SourceUrl=https\://dl.google.com/android/repository/repository-12.xml

Call Stack (most recent call first):
  /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:2 (project)


CMake Error at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:72 (message):
  Failed to parse Android NDK revision:
  /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/source.properties.

  ### Android Tool: Source of this archive.

  #Tue Mar 13 16:26:33 EET 2018

  Archive.HostBits=64

  Archive.HostOs=macosx

  Pkg.Desc=NDK

  Pkg.LicenseRef=android-sdk-license

  Pkg.Revision=16

  Pkg.SourceUrl=https\://dl.google.com/android/repository/repository-12.xml

Call Stack (most recent call first):
  /Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:6 (include)
  /Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler
  "/Users/mattitihverainen/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
  is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)




FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
> Build command failed.
  Error while executing '/Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/bin/cmake' with arguments {-H/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/src/main -B/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=/Users/mattitihverainen/Library/Android/sdk/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/obj/armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=16 -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=gnustl_shared -DANDROID_PLATFORM=android-9 -DANDROID_TOOLCHAIN=clang -DANDROID_NDK=/Users/mattitihverainen/Library/Android/sdk/ndk-bundle}
  -- Check for working C compiler: /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
  -- Check for working C compiler: /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
  See also "/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
  CMake Warning at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:63 (message):
    Using custom NDK path (ANDROID_NDK is set):
    /Users/mattitihverainen/Library/Android/sdk/ndk-bundle
  Call Stack (most recent call first):
    /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
    CMakeLists.txt:2 (project)


  CMake Error at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:72 (message):
    Failed to parse Android NDK revision:
    /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/source.properties.

    ### Android Tool: Source of this archive.

    #Tue Mar 13 16:26:33 EET 2018

    Archive.HostBits=64

    Archive.HostOs=macosx

    Pkg.Desc=NDK

    Pkg.LicenseRef=android-sdk-license

    Pkg.Revision=16

    Pkg.SourceUrl=https\://dl.google.com/android/repository/repository-12.xml

  Call Stack (most recent call first):
    /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
    CMakeLists.txt:2 (project)


  CMake Error at /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:72 (message):
    Failed to parse Android NDK revision:
    /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/source.properties.

    ### Android Tool: Source of this archive.

    #Tue Mar 13 16:26:33 EET 2018

    Archive.HostBits=64

    Archive.HostOs=macosx

    Pkg.Desc=NDK

    Pkg.LicenseRef=android-sdk-license

    Pkg.Revision=16

    Pkg.SourceUrl=https\://dl.google.com/android/repository/repository-12.xml

  Call Stack (most recent call first):
    /Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:6 (include)
    /Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)


  CMake Error: Internal CMake error, TryCompile configure of cmake failed
  CMake Error at /Users/mattitihverainen/Library/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
    The C compiler
    "/Users/mattitihverainen/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
    is not able to compile a simple test program.

    It fails with the following output:





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:2 (project)




* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library
:app:prepareComAndroidSupportAppcompatV72340Library
:app:prepareComAndroidSupportDesign2340Library
:app:prepareComAndroidSupportRecyclerviewV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComAndroidSupportSupportVectorDrawable2340Library
:app:prepareComGoogleAndroidGmsPlayServicesBase920Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement920Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm920Library
:app:prepareComGoogleAndroidGmsPlayServicesIid920Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps920Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks920Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
/Users/mattitihverainen/Fuse/Example/build/Android/Preview/app/src/main/AndroidManifest.xml:83:9-122 Warning:
	Element meta-data#com.google.android.gms.version at AndroidManifest.xml:83:9-122 duplicated with element declared at AndroidManifest.xml:64:9-122
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:generateJsonModelDebug FAILED

BUILD FAILED

Total time: 9.958 secs
(unknown): E0200: Android build failed
?: Error E0200: Android build failed
10.88 s

Build completed in 20.19 seconds
    1 error
fuse: Failed to compile project

Hey.

Try to uninstall Android NDK and install again, see this post for a possible solution.

Hope this helps.

Hello and thanks for the reply! I couldn’t find the SDKs mentioned in the forum post, but could this be the problem: “Using custom NDK path (ANDROID_NDK is set)”?

Is it normal that building uses custom NDK path which is targeted to somewhere else than Fuse’s installed Android package?

How can I remove this custom NDK path definition? Is the ANDROID_NDK set in some environment variables?

Hey.

A message about NDK path should not be a problem.

From your log, I can see your NDK path is here /Users/mattitihverainen/Library/Android/sdk/ndk-bundle/. Try deleting this folder run fuse install android.

To see environment variables on Mac run this open ~/.bash_profile. Read this post about PATH.

Hope this helps.

Thank you Arturs! That did the trick.