diff --git a/android/app/build.gradle b/android/app/build.gradle index d6969b5..e4fb903 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,6 +83,9 @@ android { applicationId 'com.alertesecours' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion + ndk { + abiFilters "armeabi-v7a", "arm64-v8a" + } versionCode 214 versionName "1.13.2" multiDexEnabled true @@ -163,6 +166,18 @@ configurations.all { resolutionStrategy { // Force non-native UCrop artifact (no .so), avoids 64KB page size issue from 2.2.6-native force "com.github.yalantis:ucrop:2.2.6" + + // Force Fresco/FBJNI versions with 16KB page support (or newer) + force "com.facebook.fresco:fresco:3.3.0" + force "com.facebook.fresco:imagepipeline:3.3.0" + force "com.facebook.fresco:imagepipeline-native:3.3.0" + force "com.facebook.fresco:gifdecoder:3.3.0" + force "com.facebook.fresco:nativeimagetranscoder:3.3.0" + force "com.facebook.fresco:static-webp:3.3.0" + force "com.facebook.fresco:webpsupport:3.3.0" + force "com.facebook.fresco:animated-webp:3.3.0" + force "com.facebook.fresco:animated-gif:3.3.0" + force "com.facebook.fbjni:fbjni:0.6.0" } // Exclude Huawei UCS native credential libs from Play build (causes 64KB alignment) exclude group: "com.huawei.hms", module: "ucs-credential" diff --git a/android/build.gradle b/android/build.gradle index 1176762..ccb2342 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -65,3 +65,28 @@ allprojects { } } } + +/** + * Force 16KB page size at link time for all subprojects that build native code with CMake. + * Use projectsEvaluated to avoid afterEvaluate on already-evaluated projects. + */ +gradle.projectsEvaluated { + subprojects { proj -> + def androidExt = proj.extensions.findByName("android") + if (androidExt != null && + androidExt.hasProperty("externalNativeBuild") && + androidExt.externalNativeBuild?.cmake != null) { + try { + def flag = "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=16384" + def args = androidExt.externalNativeBuild.cmake.arguments + if (args == null || args.isEmpty()) { + androidExt.externalNativeBuild.cmake.arguments = [flag] + } else if (!args.contains(flag)) { + androidExt.externalNativeBuild.cmake.arguments += flag + } + } catch (Throwable ignored) { + // ignore if structure differs for a subproject + } + } + } +}