diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index 1df3fb2cf8..b972816cc0 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -145,6 +145,24 @@ void main(List args) async { The Dart files (`unix.dart`, `windows.dart`) would then contain the `external` functions that use the symbols from these system libraries. +#### Note on packages that require Android's `libc++_shared.so` dynamic library + +The Android NDK developer guide +[C++ library support](libcpp_support) page explicitly states that: "`libc++` +is not a system library. If you use `libc++_shared.so`, it must be included in +your app". This is usually handled by Gradle or included by passing +`-DANDROID_STL=c++_shared` to `cmake`. + +[libcpp_support]: {{site.android-dev}}/ndk/guides/cpp-support#cs + +If your application or package depends on the C++ standard library or includes +[multiple shared libraries](runtimes), your application will likely need to +bundle the library. This can be done by depending on the library convenience +package [`android_libcpp_shared`](libcpp_shared). + +[runtimes]: {{site.android-dev}}/ndk/guides/cpp-support#shared_runtimes +[libcpp_shared]: {{site.pub}}/packages/android_libcpp_shared + ### Closed-source libraries You can also use build hooks to link against pre-compiled, closed-source