fix(android): 16k issue wip

This commit is contained in:
devthejo 2025-09-27 10:25:11 +02:00
parent bdf5c96cb9
commit b14245cead
No known key found for this signature in database
GPG key ID: 00CCA7A92B1D5351
5 changed files with 55 additions and 6 deletions

View file

@ -185,14 +185,15 @@ configurations.all {
exclude group: "com.huawei.hms.LocationLiteSdk", module: "core" exclude group: "com.huawei.hms.LocationLiteSdk", module: "core"
// Exclude Fresco native pipeline and webp natives to drop 0x1000 .so files // Exclude Fresco native pipeline and webp natives to drop 0x1000 .so files
exclude group: "com.facebook.fresco", module: "imagepipeline-native" exclude group: "com.facebook.fresco", module: "imagepipeline-native"
exclude group: "com.facebook.fresco", module: "static-webp"
exclude group: "com.facebook.fresco", module: "nativeimagetranscoder"
} }
dependencies { dependencies {
// The version of react-native is set by the React Native Gradle Plugin // The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android") implementation("com.facebook.react:react-android")
// Ensure Fresco core API available for app-level initialization (MainApplication)
implementation("com.facebook.fresco:fresco:3.6.0")
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true"; def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";

View file

@ -78,5 +78,8 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/> <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
<provider
android:name="com.facebook.drawee.backends.pipeline.FrescoInitProvider"
tools:node="remove" />
</application> </application>
</manifest> </manifest>

View file

@ -12,6 +12,8 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader import com.facebook.soloader.SoLoader
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.imagepipeline.core.ImagePipelineConfig
import expo.modules.ApplicationLifecycleDispatcher import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper import expo.modules.ReactNativeHostWrapper
@ -42,6 +44,13 @@ class MainApplication : Application(), ReactApplication {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
SoLoader.init(this, OpenSourceMergedSoMapping) SoLoader.init(this, OpenSourceMergedSoMapping)
// Initialize Fresco to avoid native memory chunk (no libimagepipeline.so load)
val builder = ImagePipelineConfig.newBuilder(this)
builder.experiment().setNativeCodeDisabled(true)
val frescoConfig = builder.build()
Fresco.initialize(this, frescoConfig)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app. // If you opted-in for the New Architecture, we load the native entry point for this app.
load() load()

View file

@ -63,8 +63,9 @@ android.enableProguardInReleaseBuilds=true
# fix notifee + expo-update crash, see https://github.com/expo/expo/issues/15298 # fix notifee + expo-update crash, see https://github.com/expo/expo/issues/15298
EX_UPDATES_ANDROID_DELAY_LOAD_APP=false EX_UPDATES_ANDROID_DELAY_LOAD_APP=false
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
expo.edgeToEdgeEnabled=false
# Ensure we always pick the NDK r27 libc++_shared.so we vendor in jniLibs # Ensure we always pick the NDK r27 libc++_shared.so we vendor in jniLibs
android.packagingOptions.pickFirsts=**/libc++_shared.so android.packagingOptions.pickFirsts=**/libc++_shared.so
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
expo.edgeToEdgeEnabled=false

View file

@ -178,7 +178,8 @@
B743D4A39B4E461798D118B9 /* Fix Xcode 15 Bug */, B743D4A39B4E461798D118B9 /* Fix Xcode 15 Bug */,
D8ED2FC173D1461F87CDF597 /* Fix Xcode 15 Bug */, D8ED2FC173D1461F87CDF597 /* Fix Xcode 15 Bug */,
F3F5A8D7A73545D78A4D8467 /* Fix Xcode 15 Bug */, F3F5A8D7A73545D78A4D8467 /* Fix Xcode 15 Bug */,
55D701B4073A47A48401F014 /* Remove signature files (Xcode workaround) */, BC7FCBEF8C354C749AB11067 /* Fix Xcode 15 Bug */,
FA5F247997BA4DDBB06F01B8 /* Remove signature files (Xcode workaround) */,
); );
buildRules = ( buildRules = (
); );
@ -1101,6 +1102,40 @@ fi";
shellScript = " shellScript = "
echo \"Remove signature files (Xcode workaround)\"; echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\"; rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
BC7FCBEF8C354C749AB11067 /* Fix Xcode 15 Bug */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Fix Xcode 15 Bug";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
echo \"Remove signature files (Xcode 15 workaround)\"
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
fi";
};
FA5F247997BA4DDBB06F01B8 /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
"; ";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */