1

After I updated my Android Studio it is giving me build command failed error. It gives me the following build error :

Build command failed.
Error while executing process /Users/bhaskarrajaryal/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/bhaskarrajaryal/AndroidStudioProjects/wowtime/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target baseUrl}
[1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libbaseUrl.so
FAILED: : && /Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=armv7-none-linux-androideabi --gcc-toolchain=/Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/sysroot -fPIC -isystem /Users/bhaskarrajaryal/Library/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=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11  -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -L/Users/bhaskarrajaryal/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,libbaseUrl.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libbaseUrl.so CMakeFiles/baseUrl.dir/src/cpp/baseUrl.cpp.o  -llog -latomic -lm "/Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
/Users/bhaskarrajaryal/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdexcept:136: error: undefined reference to 'std::logic_error::logic_error(char const*)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
2
  • try upgrading your cmake, sdk and ndk Commented May 29, 2018 at 5:55
  • I tried doing that but it still shows the same error Commented May 29, 2018 at 6:11

3 Answers 3

1

Had the same issue after the update. I did a clean build (under Build > Clean Project) then restarted android studio with the option "Invalidate and Restart" under File > Invalidate Caches/Restart. It run well after that

Sign up to request clarification or add additional context in comments.

Comments

1

Build-->Refresh Linked C++ Projects

Build Project

Comments

0

Try to do this:

Step 1: Safely delete the build folder from app directory.
Step 2: In Android Studio, File -> Invalidate Caches / Restart
Step 3: Build -> Clean Project Then Build -> Rebuild Project. so build folder will be regenerated and hope so error is gone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.