Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Unable to build NDK error #58

Open
Murtowski opened this issue Jul 5, 2018 · 6 comments
Open

Unable to build NDK error #58

Murtowski opened this issue Jul 5, 2018 · 6 comments

Comments

@Murtowski
Copy link

Murtowski commented Jul 5, 2018

Hello I can build apk.
While compiling the error is:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:externalNativeBuildDebug'.
[...]
Caused by: org.gradle.internal.UncheckedException: Build command failed.
[...]
Error while executing process /Users/xxxi/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/xxx/StudioProjects/AICamera/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target native-lib}
[1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so
[...]
error: undefined reference to 'caffe2::Predictor::run(std::__ndk1::vector<caffe2::Tensor<caffe2::CPUContext>*, std::__ndk1::allocator<caffe2::Tensor<caffe2::CPUContext>*> > const&, std::__ndk1::vector<caffe2::Tensor<caffe2::CPUContext>*, std::__ndk1::allocator<caffe2::Tensor<caffe2::CPUContext>*> >*)'
@PauliusPoc
Copy link

Hey, did you figure it out?

@Murtowski
Copy link
Author

probably i had to remove NDK from sdk manager, don't remember for sure.

@liurong79
Copy link

downgrade to ndk-r16b worked for me

@mayank10j
Copy link

Facing similar Build error while using Android Studio on Mac OS X with Latest NDK Revision 18c and NDK Revision 15c

@mayank10j
Copy link

Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/AICamera/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target native-lib}
[1/4] Building C object CMakeFiles/cpufeatures.dir/Users/
/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c.o
[2/4] Linking C static library libcpufeatures.a
[3/4] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
[4/4] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so
FAILED: : && /Users//Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/Users/mayjain/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users//Library/Android/sdk/ndk-bundle/sysroot -fPIC -isystem /Users/mayjain/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=22 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -frtti -fexceptions -std=c++11 -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /Users/mayjain/Library/Android/sdk/ndk-bundle/platforms/android-22/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -L/Users/mayjain/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -Wl,--whole-archive ../../../../src/main/jniLibs/armeabi-v7a/libCaffe2_CPU.a -Wl,--no-whole-archive ../../../../src/main/jniLibs/armeabi-v7a/libCAFFE2_NNPACK.a ../../../../src/main/jniLibs/armeabi-v7a/libCAFFE2_PTHREADPOOL.a ../../../../src/main/jniLibs/armeabi-v7a/libglog.so ../../../../src/main/jniLibs/armeabi-v7a/libprotobuf.a libcpufeatures.a -llog -landroid -ldl -latomic -lm "/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_static.a" "/Users//Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a" "/Users/**/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a" "-ldl" && :
clang++: error: unknown argument: '-nostdlib++'
ninja: build stopped: subcommand failed.

@PauliusPoc
Copy link

solved all build/ compile errors by reverting to NDK 13b and using Android Studio 3.0.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants