Skip to content

Commit 8b59fb9

Browse files
committed
static cpp
1 parent 1e1a4ad commit 8b59fb9

File tree

9 files changed

+3
-22
lines changed

9 files changed

+3
-22
lines changed

android/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@ android {
162162
resValue("string", "pushy_build_time", "0")
163163
}
164164
}
165-
166-
packagingOptions {
167-
exclude "**/libc++_shared.so"
168-
}
169-
170165
lintOptions {
171166
abortOnError false
172167
}

android/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ APP_CPPFLAGS += -std=c++17 -Oz -fno-exceptions -fno-rtti -fno-unwind-tables -fno
77
APP_LDFLAGS += -Wl,--gc-sections -Wl,--exclude-libs,ALL
88
APP_BUILD_SCRIPT := Android.mk
99
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
10-
APP_STL := c++_shared
10+
APP_STL := c++_static
396 KB
Binary file not shown.
226 KB
Binary file not shown.

android/lib/x86/librnupdate.so

358 KB
Binary file not shown.

android/lib/x86_64/librnupdate.so

391 KB
Binary file not shown.

android/src/main/java/cn/reactnative/modules/update/NativeUpdateCore.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,11 @@ static synchronized void ensureLoaded() {
1111
return;
1212
}
1313

14-
try {
15-
System.loadLibrary("c++_shared");
16-
} catch (UnsatisfiedLinkError ignored) {
17-
// Fall back to the transitive dependency load path when the host app already
18-
// packages libc++_shared.so but the linker has not loaded it yet.
19-
}
20-
2114
try {
2215
System.loadLibrary("rnupdate");
2316
} catch (UnsatisfiedLinkError error) {
2417
UnsatisfiedLinkError wrapped = new UnsatisfiedLinkError(
25-
"Failed to load rnupdate. Ensure the host app packages libc++_shared.so "
26-
+ "when using the shared C++ runtime. Original error: "
18+
"Failed to load rnupdate native library. Original error: "
2719
+ error.getMessage());
2820
wrapped.initCause(error);
2921
throw wrapped;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test": "bun test src/__tests__",
1414
"test:patch-core": "./scripts/test-patch-core.sh",
1515
"build:harmony-har": "node scripts/build-harmony-har.js",
16-
"build:so": "bun submodule && $ANDROID_HOME/ndk/28.2.13676358/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib && ./scripts/prune-host-stl.sh android/lib",
16+
"build:so": "bun submodule && $ANDROID_HOME/ndk/28.2.13676358/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib",
1717
"build:ios-debug": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.debug",
1818
"build:ios-release": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.release",
1919
"test:ios-debug": "cd Example/testHotUpdate && E2E_PLATFORM=ios detox test --configuration ios.sim.debug",

scripts/prune-host-stl.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)