From 3804996ca5365e081d1990d7fe69c513d750eb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Tue, 3 Nov 2026 13:12:30 +0100 Subject: [PATCH] Build the bare Android E2E app with resource shrinking The generated app used the React Native template defaults, which leave R8 and resource shrinking off. AGP 9 turns on the optimized resource shrinker, which removes resources the SDK looks up by name. E2E could not catch that. Enable minify and shrinkResources so it does. Co-Authored-By: Claude Sonnet 5.5 --- test/test.mts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test.mts b/test/test.mts index b69888eb..42c48f43 100644 --- a/test/test.mts +++ b/test/test.mts @@ -250,6 +250,20 @@ class RNAndroid extends Platform.Android implements RNPlatform { 'android:versionName="1.0.0"', ); + //// Build the release APK with R8 and resource shrinking, like a production app. + // The SDK looks up some resources by name (Resources.getIdentifier), which the shrinker cannot trace. + // Without a keep rule shipped by the SDK, they are removed and the tests fail. + TestUtil.replaceString( + buildGradle, + 'def enableProguardInReleaseBuilds = false', + 'def enableProguardInReleaseBuilds = true', + ); + TestUtil.replaceString( + buildGradle, + 'minifyEnabled enableProguardInReleaseBuilds', + 'minifyEnabled enableProguardInReleaseBuilds\n shrinkResources true', + ); + //// Replace the MainApplication.java with the correct server url and deployment key const string = path.join(innerprojectDirectory, 'android', 'app', 'src', 'main', 'res', 'values', 'strings.xml'); TestUtil.replaceString(string, TestUtil.SERVER_URL_PLACEHOLDER, this.getServerUrl());