Vulkan API samples building fails - android

I'm following this instruction: https://developer.android.com/ndk/guides/graphics/getting-started
And keep gettig the following error when compilling any module:
Build command failed.
Error while executing process /home/sophour/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/sophour/Code/Android/VulkanAPIsamples/API-Samples/android/texel_buffer/.externalNativeBuild/cmake/debug/x86 --target vulkan_sample}
[1/5] Building CXX object utils/CMakeFiles/vsamputils.dir/util.cpp.o
FAILED: /home/sophour/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=i686-none-linux-android --gcc-toolchain=/home/sophour/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 --sysroot=/home/sophour/Android/Sdk/ndk-bundle/sysroot -I/home/sophour/Code/Android/API-Samples/data -I/home/sophour/Android/Sdk/ndk-bundle/sources/third_party/shaderc/third_party/glslang -I/home/sophour/Code/Android/VulkanAPIsamples/API-Samples/utils -I/home/sophour/Android/Sdk/ndk-bundle/sources/android/native_app_glue -I/home/sophour/Code/Android/VulkanAPIsamples/API-Samples/utils/../android/vulkan_wrapper -I/home/sophour/Code/Android/VulkanAPIsamples/API-Samples/utils/../data -I/home/sophour/Android/Sdk/ndk-bundle/sources/third_party/shaderc/include -isystem /home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem /home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem /home/sophour/Android/Sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -D__ANDROID_API__=24 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -Werror -DVK_USE_PLATFORM_ANDROID_KHR -O0 -fno-limit-debug-info -fPIC -MD -MT utils/CMakeFiles/vsamputils.dir/util.cpp.o -MF utils/CMakeFiles/vsamputils.dir/util.cpp.o.d -o utils/CMakeFiles/vsamputils.dir/util.cpp.o -c /home/sophour/Code/Android/VulkanAPIsamples/API-Samples/utils/util.cpp
In file included from /home/sophour/Code/Android/VulkanAPIsamples/API-Samples/utils/util.cpp:40:
In file included from /home/sophour/Android/Sdk/ndk-bundle/sources/third_party/shaderc/include/shaderc/shaderc.hpp:18:
In file included from /home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/memory:81:
/home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/unique_ptr.h:76:2: error: delete called on 'shaderc::CompileOptions::IncluderInterface' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
delete __ptr;
^
/home/sophour/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/unique_ptr.h:236:4: note: in instantiation of member function 'std::default_delete<shaderc::CompileOptions::IncluderInterface>::operator()' requested here
get_deleter()(__ptr);
^
/home/sophour/Android/Sdk/ndk-bundle/sources/third_party/shaderc/include/shaderc/shaderc.hpp:133:3: note: in instantiation of member function 'std::unique_ptr<shaderc::CompileOptions::IncluderInterface, std::default_delete<shaderc::CompileOptions::IncluderInterface> >::~unique_ptr' requested here
CompileOptions() { options_ = shaderc_compile_options_initialize(); }
^
1 error generated.
ninja: build stopped: subcommand failed.
I'm absolutely new to this and have no experience in native android development. Help me solve this, please-please! A need it badly for my thesis!
Ubuntu 14.04;
Android Studio 3.1.2;
NDK: r17;
Compile SDK: API 24: Android 7.0 (Nougat);
Gradle 3.3

It looks like the problem is in the android NDK headers. Specifically in:
Android/Sdk/ndk-bundle/sources/third_party/shaderc/include/shaderc/shaderc.hpp
They declare shaderc::CompileOptions::IncluderInterface as a virtual class, but have no virtual destructor:
class IncluderInterface {
public:
// Handles shaderc_include_resolver_fn callbacks.
virtual shaderc_include_result* GetInclude(const char* requested_source,
shaderc_include_type type,
const char* requesting_source,
size_t include_depth) = 0;
// Handles shaderc_include_result_release_fn callbacks.
virtual void ReleaseInclude(shaderc_include_result* data) = 0;
};
I would not normally recommend this, but it seems you have no other choice. You could remove the -Wdelete-non-virtual-dtor or -Werror from the make files so that it will not error out for that mistake? Probably not a solution for the long term... The better solution would be to find out who makes the third party header: shaderc.hpp and ask them nicely to fix it...
Other options would be to use OpenGL in the Java SDK, or to write the Vulkan part from scrap and not use the sample code. I recently wrote an android app which uses Vulkan, and have not encountered this error.

Related

ld: Unknown symbol error when trying to run a C++ library - incorrect CMakeLists.txt settings [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed last month.
I've downloaded an external c++ library for use inside a Flutter program via FFI. I've set up the FFI correctly, but I'm getting an error whenever I have the use the function from the external library. Here's the function:
#include <iostream>
#include "aoo/include/aoo/aoo.h"
#include "aoo/include/aoo/aoo_server.h"
#include "aoo/include/aoo/aoo_net.h"
extern "C" void initAoo(){
aoo_initialize(0);
std::cout << "Called from init AOO!" << std::endl;
}
When I compile and run to an android device, I get this error:
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /Users/zacharyhaslam/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /Users/zacharyhaslam/FlutterApplications/state_management_example/android/app/.cxx/cmake/debug/armeabi-v7a add}
ninja: Entering directory `/Users/zacharyhaslam/FlutterApplications/state_management_example/android/app/.cxx/cmake/debug/armeabi-v7a'
[1/2] Building CXX object CMakeFiles/add.dir/cpp/add.cpp.o
[2/2] Linking CXX shared library /Users/zacharyhaslam/FlutterApplications/state_management_example/build/app/intermediates/cmake/debug/obj/armeabi-v7a/libadd.so
FAILED: /Users/zacharyhaslam/FlutterApplications/state_management_example/build/app/intermediates/cmake/debug/obj/armeabi-v7a/libadd.so
: && /Users/zacharyhaslam/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi19 --sysroot=/Users/zacharyhaslam/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fno-limit-debug-info -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libadd.so -o /Users/zacharyhaslam/FlutterApplications/state_management_example/build/app/intermediates/cmake/debug/obj/armeabi-v7a/libadd.so CMakeFiles/add.dir/cpp/add.cpp.o -latomic -lm && :
ld: error: undefined symbol: aoo_initialize
>>> referenced by add.cpp:11 (../../../../../cpp/add.cpp:11)
>>> CMakeFiles/add.dir/cpp/add.cpp.o:(initAoo)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed
It says ld: error: undefined symbol: aoo_initialize. From my research, I think the problem must be from the way that I set up the compilation settings, so here's my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10.2)
add_library( add
SHARED
cpp/add.cpp
)
include_directories(cpp/aoo/include/aoo/aoo.h)
add_library(aoo cpp/aoo/include/aoo/aoo.h)
set_target_properties(aoo PROPERTIES LINKER_LANGUAGE CXX)
What is wrong with CMakeLists.txt? Am I properly including the files for compilation?
The basic problem is that aoo is not built. You'll need to take care of that.
I assume that your program is the target "add" and the source above is in cpp/add.cpp
Basically need to setup the aoo library correctly and then tell CMake to link your program against it.
add_library(aoo)
target_include_directories(aoo PUBLIC aoo/include)
target_sources(aoo PRIVATE aoo/src/library-source1.cc
aoo/src/library-source2.cc
...)
add_library(add SHARED)
target_sources(add PRIVATE cpp/add.cpp)
target_link_libraries(add PRIVATE aoo)
You will need to find out how aoo needs to be built though.
However, if you setup it well, you can #include <aoo/aoo.h> as CMake will also tell the compiler where to find the includes.
If aoo provides CMake integration, it may also be possible to just use that.

android studio 3.2 initial build error (testCCompiler.c file not found, windows 10)

today I installed android studio 3.2.1 on my windows 10 PC at home.
(I have installed a previous version 3 months ago but I unstalled it before installing new one, because it had similar problem I remember)
When I install the program, it is supposed to build itself but it fails with below messages.
Run Build Command:"C:/Users/Chan
Kim/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe" "cmTC_4535f"
[1/2] Building C object CMakeFiles/cmTC_4535f.dir/testCCompiler.c.o
FAILED:
C:\Users\CHANKI~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv7-none-linux-androideabi24 --gcc-toolchain="C:/Users/Chan
Kim/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Chan Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot"
-isystem C:/Users/Chan
Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong
-no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
-mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security -fPIE
-o CMakeFiles/cmTC_4535f.dir/testCCompiler.c.o -c
C:\ANDPRG\app\.externalNativeBuild\cmake\release\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c
error: no such file or directory:
'Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/ANDPRG/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/ANDPRG/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\Chan Kim\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\ANDPRG\app -BC:\ANDPRG\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-24 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\ANDPRG\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Chan Kim\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Chan Kim\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Chan Kim\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Chan Kim/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Chan Kim/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/ANDPRG/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Chan
Kim/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe" "cmTC_23398"
[1/2] Building C object CMakeFiles/cmTC_23398.dir/testCCompiler.c.o
FAILED:
C:\Users\CHANKI~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv7-none-linux-androideabi24 --gcc-toolchain="C:/Users/Chan
Kim/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Chan Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot"
-isystem C:/Users/Chan
Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong
-no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
-mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security -fPIE
-o CMakeFiles/cmTC_23398.dir/testCCompiler.c.o -c
C:\ANDPRG\app\.externalNativeBuild\cmake\debug\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c
error: no such file or directory:
'Kim/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/ANDPRG/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/ANDPRG/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
I saw similar question on SO but it's not exactly same to my situtation and I tried the suggestions(Refresh linked C++ project) and it didn't work. and some advices are for linux. The first error message is 'can't find cCompilerProgram.c' for cmake.(When I look into the folder, the file is not actuall there) How can I solve this? By the way, my login name on windows 10 is 'Chan Kim' with space in the middle. Can it have any problem? I guess the testCCompiler.c file is what the build process make during the build.
Any suggestion will be deeply appreciated.
the error actually reads:
-- Check for working C compiler: .../prebuilt/windows-x86_64/bin/clang.exe -- broken
this seems related.
My problem was that my login name in windows10 was 'Chan Kim' and the error log shows it cannot parse down the folder name containing 'Chan Kim' and it cannot process space in the folder name. So I created a new account 'ckim' and did the same (it downloads huge amount of data under C:\Users\ckim this time) and everything works fine.
So DON'T USE USERNAME WITH SPACE whne using android studio. (I don't know why the book and android studio doesn't warn about this situtation. I read in the book, if my login name contains Korean characters, it won't work. but it turns out login name with space doesn't work either).
Hope this be useful for someone.
ADD : I tried configuring the SDK again using Users\ChanKim\AppData folder and it works too. (originally it was using Users\Chan Kim\AppData)

ROLI JUCE Android CMake Error, Generated blank demo app fails to compile in Android Studio

Having downloaded the Projucer I generated a blank application, I exported it to Android (in debug mode) and opened it in Android studio.
After fixing errors to do with the versions of the SDK and NDK (I updated the references to build with the most recent version) the code fails to build at the CMake stage with the below error output:
Build command failed.
Error while executing process /Users/user/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/user/Documents/Blank/Builds/Android/app/.externalNativeBuild/cmake/debug_Debug/x86 --target juce_jni}
[1/16] Building C object CMakeFiles/cpufeatures.dir/Users/user/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c.o
[2/16] Linking C static library libcpufeatures.a
[3/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_basics.cpp.o
[4/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_devices.cpp.o
[5/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_formats.cpp.o
[6/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_audio_processors.cpp.o
[7/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_core.cpp.o
[8/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_cryptography.cpp.o
[9/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_data_structures.cpp.o
[10/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_events.cpp.o
[11/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_graphics.cpp.o
[12/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_gui_basics.cpp.o
[13/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_gui_extra.cpp.o
[14/16] Building CXX object CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o
FAILED: /Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=i686-none-linux-android28 --gcc-toolchain=/Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64 -DDEBUG=1 -DJUCER_ANDROIDSTUDIO_7F0E4A25=1 -DJUCE_ANDROID=1 -DJUCE_ANDROID_ACTIVITY_CLASSNAME=com_yourcompany_blank_Blank -DJUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/yourcompany/blank/Blank\" -DJUCE_ANDROID_API_VERSION=10 -DJUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSNAME=com_yourcompany_blank_SharingContentProvider -DJUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH=\"com/yourcompany/blank/SharingContentProvider\" -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 -DJUCE_PUSH_NOTIFICATIONS=1 -D_DEBUG=1 -Djuce_jni_EXPORTS -I../../../../../../../JuceLibraryCode -I/Users/user/Downloads/JUCE/modules -I/Users/molly/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures --sysroot /Users/user/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -std=c++11 -fexceptions -frtti -fsigned-char -std=c++14 -O0 -fno-limit-debug-info -O0 -fPIC -MD -MT CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o -MF CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o.d -o CMakeFiles/juce_jni.dir/Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp.o -c /Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp
In file included from /Users/user/Documents/Blank/JuceLibraryCode/include_juce_opengl.cpp:9:
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:118:26: error: no member named 'glDrawBuffer' in the global namespace; did you mean simply 'glDrawBuffer'?
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Downloads/JUCE/modules/juce_opengl/native/juce_OpenGLExtensions.h:69:5: note: expanded from macro 'JUCE_GL_BASE_FUNCTIONS'
USE_FUNCTION (glDrawBuffer, void, (GLsizei p1, const GLenum* p2), (p1, p2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:116:72: note: expanded from macro 'JUCE_DECLARE_GL_FUNCTION'
returnType OpenGLExtensionFunctions::name params noexcept { return ::name callparams; }
^~
/Users/user/Downloads/JUCE/modules/juce_opengl/juce_opengl.cpp:118:2: note: 'glDrawBuffer' declared here
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
^
/Users/user/Downloads/JUCE/modules/juce_opengl/native/juce_OpenGLExtensions.h:69:19: note: expanded from macro 'JUCE_GL_BASE_FUNCTIONS'
USE_FUNCTION (glDrawBuffer, void, (GLsizei p1, const GLenum* p2), (p1, p2))
^
1 error generated.
ninja: build stopped: subcommand failed.
I have tried reinstalling the Projucer, running different versions of Android Studio and generating different Demo projects but they all fail at the same point. When generating an Xcode file on the same computer (macOS) and same Projucer download the code does compile and run on an emulated iOS.
Am I missing some library or is there an incorrect file path somewhere?
The file that throws the error is from their own library so I am unsure what could be causing the issue, any help would be much appreciated!
The error occurs specifically on the line USE_FUCNTION(glDrawBuffer ...) as I have tried moving this line of code in the library file and the error moves with it (it is at the end of a code block so I wanted to see if it was that code block that was failing but it seems to be specifically that line)
Set the “Minimum SDK Version” in the Android exporter to something like 24, rather than the default of 10.
The current default is a little low and will be bumped up to 28 in the next JUCE release.

Android Studio: External Native Build Issues

I cloned a project from a github repository and opened it in my Android Studio 3.0.
As soon as I open up Android Studio I get an Error:
Cannot load module file 'C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml':
File C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml does not exist
Would you like to remove module 'Bookingtest' from the project?
I don't understand why a file doesn't exist when I cloned the project right from the github.
Another Error that come up with the Gradle Sync is and External Native Build Issue.
External Native Build Issues
Build command failed.
Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/David
Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_93f60"
[1/2] Building C object CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o
FAILED:
C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv5te
-mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
-Wformat -Werror=format-security -fPIE -o
CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o -c "C:\Users\David
Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeOutput.log".
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/David
Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_17c6b"
[1/2] Building C object CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o
FAILED:
C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv5te
-mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
-Wformat -Werror=format-security -fPIE -o
CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o -c "C:\Users\David
Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeOutput.log".
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeError.log".
C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake
Error:Error:line (61)/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
Error:Error:line (61)/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
I've tired to search for answers on this subject and have come across some answers that are similar to my question except they are not solutions for my specific question.
I'm stuck at a wall and don't know what to do to resolve this Error. All I want to do is clone a repo from github and work on the project in Android studio. All of my SDKs are installed.
This may be caused by the space in the folder C:/Users/David Ferrara/AppData/Local/
If so, it is likely a bug in Android Studio, CMake, or ninja

nme haxe, unable to build on android platform with flashdevelop

I'm just getting to know nme haxe developing, I'm currently using flashdevelop. I have a problem when building a sample app (piratepig) under android platform. Lots of "no such file or directory". Everything seems fine when I choose windows, Html5, or flash platforms.
Here's the output:
Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\Valentin\Desktop\PiratePig\Pirate Pig.hxproj" -ipc 2a666e48-3f38-4abd-b63a-25219cb72cf4 -version "2.10" -compiler "C:\Motion-Twin\Haxe" -library "C:\Program Files (x86)\FlashDevelop\Library" -target "android"
Building Pirate Pig
haxelib run nme build C:\Users\Valentin\Desktop\PiratePig\project.nmml android -debug
haxelib run hxcpp Build.xml haxe -Ddebug -Dactuate -Dandroid -Dcpp -Ddebug -Dhaxe_208 -Dhaxe_209 -Dhaxe_210 -Dmobile -Dnme -Dnme_install_tool -Dsys -Dtrue
Creating hxcpp.h.gch...
arm-linux-androideabi-g++ -Iinclude --sysroot=C:\Development\Android NDK/platforms/android-5/arch-arm -IC:\Development\Android NDK/sources/cxx-stl/gnu-libstdc++/include -IC:\Development\Android NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -Dhaxe_210 -IC:\Motion-Twin\Haxe\lib\hxcpp\2,10//include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -D_LINUX_STDDEF_H -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID -Wa,--noexecstack -O0 -DNDEBUG -c -frtti -o hxcpp.h.gch C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h:13:20: error: typeinfo: No such file or directory
In file included from C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h:170:
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/Array.h:195:21: error: algorithm: No such file or directory
In file included from C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h:162:
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hx/Object.h: In member function 'void hx::ObjectPtr<O>::CastPtr(hx::Object*)':
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hx/Object.h:143: error: must #include <typeinfo> before using typeid
In file included from C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h:170:
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/Array.h: In member function 'void Array_obj<ELEM_>::sort(Dynamic)':
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/Array.h:388: error: 'sort' is not a member of 'std'
In file included from C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/hxcpp.h:171:
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/Class.h: In function 'bool hx::TCanCast(hx::Object*)':
C:\Motion-Twin\Haxe\lib\hxcpp\2,10//include/Class.h:139: error: must #include <typeinfo> before using typeid
Called from ? line 1
Called from BuildTool.hx line 1265
Called from BuildTool.hx line 554
Called from BuildTool.hx line 591
Called from BuildTool.hx line 710
Called from BuildTool.hx line 739
Called from BuildTool.hx line 153
Uncaught exception - Error creating pch: 1 - build cancelled
Error : Build failed
Build halted with errors (haxelib.exe).
Done(1)
Does anyone have a clue, what could be wrong? I tried running a simple helloworld app in eclipse (so that i can be sure that its related to haxe, and nme), but the helloword app works perfectly.
did you use NME 3.5.3 or higher?
then you need to switch to hxcpp 2.10.3 . it will solve the problem. try to update the hxcpp through haxelib with this command
haxelib upgrade
The problem was solved a long time ago, through some hit on google. I cant find it now, but it was something about the NDK directory, i had to move or copy some files in the structure.
It might have been something like this
As far as I remember it was something similar to this (answer posted by Andy on openfl):
Copy the files from
${ANDROID_NDK_ROOT}\sources\cxx-stl\gnu-libstdc++\4.4.3\ to
${ANDROID_NDK_ROOT}\sources\cxx-stl\gnu-libstdc++\
Here's the link to his answer, and some similar questions above:
http://www.openfl.org/developer/forums/installing-openfl/beginner-questions-android-build-failed/

Categories

Resources