From 8ce0cd4e244c956b45a8156a2116efd0cca2d597 Mon Sep 17 00:00:00 2001 From: zeyus Date: Mon, 23 Mar 2026 12:08:10 +0100 Subject: [PATCH 1/5] Added note regarding libc++_shared.so in the bind-native-code documentation. --- .../platform-integration/bind-native-code.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index 1df3fb2cf8..1b6706b014 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -145,6 +145,20 @@ 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](https://developer.android.com/ndk/guides/cpp-support#cs) +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`. If your +application or package depends on the C++ standard library or includes +[multiple shared libraries](https://developer.android.com/ndk/guides/cpp-support#shared_runtimes), +your application will likely need to bundle the library. This can be done by +including the appropriate `libc++_shared.so` library for the host platform and +target architecture in `build.dart` or by depending on the library convenience +package [`android_libcpp_shared`](https://pub.dev/packages/android_libcpp_shared). + ### Closed-source libraries You can also use build hooks to link against pre-compiled, closed-source From 96ff74c6fb86024c9a27731c7292cb8050ed9c7c Mon Sep 17 00:00:00 2001 From: zeyus Date: Mon, 23 Mar 2026 12:14:01 +0100 Subject: [PATCH 2/5] Broke into two paragraphs --- src/content/platform-integration/bind-native-code.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index 1b6706b014..7d8295d7f3 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -151,8 +151,9 @@ The Android NDK developer guide [C++ library support](https://developer.android.com/ndk/guides/cpp-support#cs) 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`. If your -application or package depends on the C++ standard library or includes +by Gradle or included by passing `-DANDROID_STL=c++_shared` to `cmake`. + +If your application or package depends on the C++ standard library or includes [multiple shared libraries](https://developer.android.com/ndk/guides/cpp-support#shared_runtimes), your application will likely need to bundle the library. This can be done by including the appropriate `libc++_shared.so` library for the host platform and From 7e5151389f018c5a9f72e5dbae5df6f72f7dfed7 Mon Sep 17 00:00:00 2001 From: zeyus Date: Mon, 23 Mar 2026 12:21:38 +0100 Subject: [PATCH 3/5] Replace explicit pub.dev and Android developer links with template. --- src/content/platform-integration/bind-native-code.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index 7d8295d7f3..967cc9152f 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -148,17 +148,17 @@ 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](https://developer.android.com/ndk/guides/cpp-support#cs) +[C++ library support]({{site.android-dev}}/ndk/guides/cpp-support#cs) 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`. If your application or package depends on the C++ standard library or includes -[multiple shared libraries](https://developer.android.com/ndk/guides/cpp-support#shared_runtimes), +[multiple shared libraries]({{site.android-dev}}/ndk/guides/cpp-support#shared_runtimes), your application will likely need to bundle the library. This can be done by including the appropriate `libc++_shared.so` library for the host platform and target architecture in `build.dart` or by depending on the library convenience -package [`android_libcpp_shared`](https://pub.dev/packages/android_libcpp_shared). +package [`android_libcpp_shared`]({{site.pub}}/packages/android_libcpp_shared). ### Closed-source libraries From ae37aa642543aac424f5ce4ee5ec8253e30b4c31 Mon Sep 17 00:00:00 2001 From: zeyus Date: Mon, 23 Mar 2026 12:26:02 +0100 Subject: [PATCH 4/5] Refactor links based on gemini suggestion. --- .../platform-integration/bind-native-code.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index 967cc9152f..a7d61c6881 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -148,17 +148,22 @@ 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]({{site.android-dev}}/ndk/guides/cpp-support#cs) -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`. +[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]({{site.android-dev}}/ndk/guides/cpp-support#shared_runtimes), -your application will likely need to bundle the library. This can be done by -including the appropriate `libc++_shared.so` library for the host platform and -target architecture in `build.dart` or by depending on the library convenience -package [`android_libcpp_shared`]({{site.pub}}/packages/android_libcpp_shared). +[multiple shared libraries](runtimes), your application will likely need to +bundle the library. This can be done by including the appropriate +`libc++_shared.so` library for the host platform and target architecture in +`build.dart` or 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 From 3aa241e438ee72bb085c371ebe30a4389d77de27 Mon Sep 17 00:00:00 2001 From: zeyus Date: Mon, 23 Mar 2026 13:35:34 +0100 Subject: [PATCH 5/5] Remove information about manual lib bundling. --- src/content/platform-integration/bind-native-code.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/content/platform-integration/bind-native-code.md b/src/content/platform-integration/bind-native-code.md index a7d61c6881..b972816cc0 100644 --- a/src/content/platform-integration/bind-native-code.md +++ b/src/content/platform-integration/bind-native-code.md @@ -157,10 +157,8 @@ your app". This is usually handled by Gradle or included by passing 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 including the appropriate -`libc++_shared.so` library for the host platform and target architecture in -`build.dart` or by depending on the library convenience package -[`android_libcpp_shared`](libcpp_shared). +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