Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Why am I getting an error message from Android NDK r11 while my project is built using Android NDK r16?

Ask Question

I have an Android project with a third party library ( .so ). Along with the third party .so file, I'm also providing the libc++_shared.so library that is needed along with the third party library.

After building the Android project and running it on an Android device (Android 6.x), I get this abort message:

[INFO] libc: /Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-72234/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type

The problem here is that I don't have the Android NDK r11 configured within my system ( MacOS ). I downloaded and configured the Android NDK r16 . I also can see during the build the configured NDK is used (path of my configured ANDROID_NDK within my .bash_profile ).

This llvm-libc++ of r11 is not compatible with the third party .so library. Why am I getting the abort message from the NDK r11 ?

Let's ask a different question: is /Volumes/Android/buildbot/ a valid path on your Mac? Probably, it isn't. In which case the message is triggered by some library you are using. You can grep the prebuilt libraries for this message to pin the troublemaker. Alex Cohn May 6, 2018 at 16:15 Hi Alex, It isn't a valid path on my Mac, indeed. And it isn't also a valid one on the Android device. How could it ( abort_message ) then called/triggered? And besides that I'm also providing the libc++_shared.so file along and see it's packaged within the APK. Is there a way to tell the system to only use the provided one? But I'll look into the provided libraries to start with to identify any matching messages.. YakupKalin May 6, 2018 at 18:03 Guys, I posted the answer on my question. Thanks for the effort and provided info that helped me finding the answer! YakupKalin May 6, 2018 at 19:44

To answer my own question. It seems that the Mobile Application Development Platform (Appcelerator Titanium) I'm using was injecting its own libc++_shared.so file during the app build phase. This is why my own libc++_shared.so file didn't get in the APK file. It was another file all along. And that file was from the Android NDK r11 .

The file that is copied during the build phase is located within the Titanium SDK: sdk/android/native/libs/*/libc++_shared.so .

This sounds like a very bad SDK design . You can force the latest version of libc++_shared.so to be packaged, but who can guarantee that Titanium will work with it correctly? You can probably build Titanium from sources , but even then I recommend to switch to static STL. Alex Cohn May 7, 2018 at 8:40

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .