Build issue on Windows for Android app

Hi, getting the following error:
Error:A problem occurred configuring project ‘:app’.

executing external native build for cmake C:\Users\leehu\Development\cpp\JUCE\Projects\xxx\Builds\Android\app\CMakeLists.txt

Not sure how to proceed - same Projucer file works fine on OSX.

thx

You need to post the full gradle log. Usually there is a line (pretty hidden) about the reason why cmake failed - usually because it couldn’t find a file or library you are referring to.

got ya - sorry, stlll finding my way round Anroid Studio

yes, missing library… actually, related to

as I can’t find a way to automatically copy Android libraries to a destination… Is there a way to do this? thx

Hi, I’ve copied the missing library manually and still no joy. This is the gradle output:

Executing tasks: [:app:generateDebug_DebugSources, :app:prepareDebug_DebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebug_DebugAndroidTestSources, :app:compileDebug_DebugSources, :app:compileDebug_DebugUnitTestSources, :app:compileDebug_DebugAndroidTestSources]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Configuring incomplete, errors occurred!
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
See also “C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app/.externalNativeBuild/cmake/release_Release/armeabi/CMakeFiles/CMakeOutput.log”.
Please set them or make sure they are set and tested correctly in the CMake files:
midisynthlib
linked by target “juce_jni” in directory C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Configuring incomplete, errors occurred!
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
See also “C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app/.externalNativeBuild/cmake/release_Release/armeabi-v7a/CMakeFiles/CMakeOutput.log”.
midisynthlib
linked by target “juce_jni” in directory C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Configuring incomplete, errors occurred!
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
See also “C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app/.externalNativeBuild/cmake/release_Release/x86/CMakeFiles/CMakeOutput.log”.
midisynthlib
linked by target “juce_jni” in directory C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
– Check for working C compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
– Check for working CXX compiler: C:/Users/leehu/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Configuring incomplete, errors occurred!
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
See also “C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app/.externalNativeBuild/cmake/release_Release/mips/CMakeFiles/CMakeOutput.log”.
Please set them or make sure they are set and tested correctly in the CMake files:
midisynthlib
linked by target “juce_jni” in directory C:/Users/leehu/Development/cpp/JUCE/Projects/MIDISynth-Circuit/Builds/MIDISynth_Circuit/app

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

executing external native build for cmake C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\MIDISynth_Circuit\app\CMakeLists.txt

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

BUILD FAILED

Total time: 23.039 secs

We do this regularly at ROLI so it should definitely work.Obviously, it’s having trouble to find midisynthlib. In the projucer, are you sure the you have specified the “Extra Library Search Paths” correctly?

In case you need help troubleshooting where it is trying to load the library from, I recommend using Process Monitor from the SysInternals tools (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon). You can filter the file system activity by the library name, and see where the linker is actual trying to load the library from. This has helped me understand issues like these many times.

Hi fabian. This is my search path:

~/Development/cpp/JUCE/lib/android/debug

This works on OSX and there’s only 1 config for Android, so OSX is using the same settings

Hi @leehu,

Does the tilde ~ work on Windows? I don’t think the Android build environment is executed in a UNIX-type shell. Can you try replacing the path with the absolute path. In any case, the Projucer should take care of replacing the ~ character if it isn’t supported. I’ll have a look.

Fabian

Still the same - going to try and manually configure AS to try and pick this library up…

sorry, that did work - it needs to have the full patch including drive letter

Not sure where the ~ replacement should be happening, but the generated cmake file still contains the ~ if the substitution should have been done by this point…

thx

For release it appears as though I need to create a new configuration for each architecture so I can specify the correct path to pick the library up from. This is fine, but not sure then how to go about creating a single APK for the Google store that contains all of the architectures…

image

You can use ${ANDROID_ABI} in the library search paths. For example this is what we do in NOISE: