Failing to export Android due to CMake

I have a mobile project with few people and the project is successfully exported in other’s computer. However I cannot. I used “Export>Export for Android” in Fuse studio.

Uno 1.9.0 (dev-build) Windows 8.1 x64 N/A
Copyright (C) 2015-2018 Fusetools


Configuring
  14.29 s
Compiling syntax tree
C:\Users\User\mobile-project\libs\bolav\fuse-touchid\iOSFingerPrint.uno(18.7): W0000: The variable 'reason' is assigned but its value is never used



C:\Users\User\mobile-project\libs\Firebase.Notifications.Android\JS.uno(101.42): W4139: 'Fuse.Scripting.NativeEvent.RaiseAsync(object[])' is obsolete: 'Use `RaiseAsync(IThreadWorker, params object[])` instead'
C:\Users\User\mobile-project\libs\Firebase.Notifications.Android\JS.uno(103.42): W4139: 'Fuse.Scripting.NativeEvent.RaiseAsync(object[])' is obsolete: 'Use `RaiseAsync(IThreadWorker, params object[])` instead'

C:\Users\User\mobile-project\libs\bolav\fuse-touchid\iOSFingerPrint.uno(65.13): W4139: 'Fuse.Scripting.Function.Call(object[])' is obsolete: 'use Call(Context, params object[]) instead'
C:\Users\User\mobile-project\libs\bolav\fuse-touchid\iOSFingerPrint.uno(25.12): W4139: 'Fuse.Scripting.Context.Invoke(Uno.Action)' is obsolete: 'Use Invoke(Action<Context>) instead'
C:\Users\User\mobile-project\libs\bolav\fuse-touchid\iOSFingerPrint.uno(69.11): W4139: 'Fuse.Scripting.Context.Invoke(Uno.Action)' is obsolete: 'Use Invoke(Action<Context>) instead'

4.74 s

Generating code and data
  10.60 s
Building Android app
CMake Error at C:/Users/User/AppData/Local/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake:265 (message):
  gnustl_shared is no longer supported.  Please switch to either c++_shared
  or c++_static.  See
  https://developer.android.com/ndk/guides/cpp-support.html for more
  information.
Call Stack (most recent call first):
  C:/Users/User/AppData/Local/Android/Sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:2 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
> Build command failed.
Error while executing 'C:\Users\User\AppData\Local\Android\sdk\cmake\3.6.4111459\bin\cmake.exe' with arguments {-HC:\Users\User\mobile-project\build\Android\Debug\app\src\main -BC:\Users\User\mobile-project\build\Android\Debug\app\.externalNativeBuild\cmake\debug\armeabi-v7a -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=C:\Users\User\AppData\Local\Android\sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\User\mobile-project\build\Android\Debug\app\.externalNativeBuild\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=C:\Users\User\AppData\Local\Android\sdk\cmake\3.6.4111459\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=C:\Users\User\AppData\Local\Android\sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=19 -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=gnustl_shared -DANDROID_PLATFORM=android-9 -DANDROID_TOOLCHAIN=clang -DANDROID_NDK=C:/Users/User/AppData/Local/Android/sdk/ndk-bundle}
-- android-9 is unsupported. Using minimum supported version 16.
-- Configuring incomplete, errors occurred!
CMake Error at C:/Users/User/AppData/Local/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake:265 (message):
  gnustl_shared is no longer supported.  Please switch to either c++_shared
  or c++_static.  See
  https://developer.android.com/ndk/guides/cpp-support.html for more
  information.
Call Stack (most recent call first):
  C:/Users/User/AppData/Local/Android/Sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:2 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage


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



(unknown): E0200: Android build failed

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 UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging920Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: C:\Users\User\mobile-project\build\Android\Debug\app\google-services.json
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:generateJsonModelDebug FAILED

BUILD FAILED

Total time: 22.451 secs
24.02 s

Build completed in 53.68 seconds
    6 warnings
    1 error

fuse: Errors were encountered while building the project

I have tried few options like change the environment variable of CMake PATH, etc. , did not work.
Also a new Hello World project did not work.

I believe the problem is that you’re running the latest android and need to downgrade the android NDK used for your current fuse version(1.9.0), have a look here how to do that: Oct 2018 - Fresh install of Android with fuse 1.9.0 on Windows 10 64bit

1 Like

It works. Thank you very much.:grinning:

How will you know what version of android to use for the specific version of fuse?

Thanks

At this point, its just from experience.

You should be trying to use the latest versions of everything, especially if you want to keep up with latest fixes and features like iOS13 support.

You can always specify SDK versions for android like so:

"Android": {
      "SDK": {
            "BuildToolsVersion": "28.0.3",
            "CompileVersion": 28,
            "MinVersion": 19,
            "TargetVersion": 28
          },
      ...
}

Unfortunately, it means that the old fuse studios preview is not compatible but that’s why we have a cookie jar for funding a new preview: https://opencollective.com/fuse-open

will take note on this and thank you very much . and just a followup question, if you could look into this thread Unable to Export Android App. been having some issues in exporting my fuse project to android cant seem to find why, im just starting to use Fuse though. Thanks :slight_smile: