@@ -14,6 +14,7 @@ react {
1414 hermesCommand = new File ([" node" , " --print" , " require.resolve('react-native/package.json')" ]. execute(null , rootDir). text. trim()). getParentFile(). getAbsolutePath() + " /sdks/hermesc/%OS-BIN%/hermesc"
1515 codegenDir = new File ([" node" , " --print" , " require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })" ]. execute(null , rootDir). text. trim()). getParentFile(). getAbsoluteFile()
1616
17+ enableBundleCompression = (findProperty(' android.enableBundleCompression' ) ?: false ). toBoolean()
1718 // Use Expo CLI to bundle the app, this ensures the Metro config
1819 // works correctly with Expo projects.
1920 cliFile = new File ([" node" , " --print" , " require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })" ]. execute(null , rootDir). text. trim())
@@ -63,9 +64,9 @@ react {
6364}
6465
6566/**
66- * Set this to true to Run Proguard on Release builds to minify the Java bytecode .
67+ * Set this to true in release builds to optimize the app using [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) .
6768 */
68- def enableProguardInReleaseBuilds = (findProperty(' android.enableProguardInReleaseBuilds ' ) ?: false ). toBoolean()
69+ def enableMinifyInReleaseBuilds = (findProperty(' android.enableMinifyInReleaseBuilds ' ) ?: false ). toBoolean()
6970
7071/**
7172 * The preferred build flavor of JavaScriptCore (JSC)
@@ -78,7 +79,7 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea
7879 * give correct results when using with locales other than en-US. Note that
7980 * this variant is about 6MiB larger per architecture than default.
8081 */
81- def jscFlavor = ' org.webkit:android- jsc: +'
82+ def jscFlavor = ' io.github.react-native-community: jsc-android:2026004. +'
8283
8384android {
8485 ndkVersion rootProject. ext. ndkVersion
@@ -93,6 +94,8 @@ android {
9394 targetSdkVersion rootProject. ext. targetSdkVersion
9495 versionCode 59
9596 versionName " 0.9.4"
97+
98+ buildConfigField " String" , " REACT_NATIVE_RELEASE_LEVEL" , " \" ${ findProperty('reactNativeReleaseLevel') ?: 'stable'} \" "
9699 }
97100 signingConfigs {
98101 debug {
@@ -110,15 +113,18 @@ android {
110113 // Caution! In production, you need to generate your own keystore file.
111114 // see https://reactnative.dev/docs/signed-apk-android.
112115 signingConfig signingConfigs. debug
113- shrinkResources (findProperty(' android.enableShrinkResourcesInReleaseBuilds' )?. toBoolean() ?: false )
114- minifyEnabled enableProguardInReleaseBuilds
116+ def enableShrinkResources = findProperty(' android.enableShrinkResourcesInReleaseBuilds' ) ?: ' false'
117+ shrinkResources enableShrinkResources. toBoolean()
118+ minifyEnabled enableMinifyInReleaseBuilds
115119 proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
116- crunchPngs (findProperty(' android.enablePngCrunchInReleaseBuilds' )?. toBoolean() ?: true )
120+ def enablePngCrunchInRelease = findProperty(' android.enablePngCrunchInReleaseBuilds' ) ?: ' true'
121+ crunchPngs enablePngCrunchInRelease. toBoolean()
117122 }
118123 }
119124 packagingOptions {
120125 jniLibs {
121- useLegacyPackaging (findProperty(' expo.useLegacyPackaging' )?. toBoolean() ?: false )
126+ def enableLegacyPackaging = findProperty(' expo.useLegacyPackaging' ) ?: ' false'
127+ useLegacyPackaging enableLegacyPackaging. toBoolean()
122128 }
123129 }
124130 androidResources {
@@ -156,15 +162,15 @@ dependencies {
156162
157163 if (isGifEnabled) {
158164 // For animated gif support
159- implementation(" com.facebook.fresco:animated-gif:${ reactAndroidLibs .versions.fresco.get()} " )
165+ implementation(" com.facebook.fresco:animated-gif:${ expoLibs .versions.fresco.get()} " )
160166 }
161167
162168 if (isWebpEnabled) {
163169 // For webp support
164- implementation(" com.facebook.fresco:webpsupport:${ reactAndroidLibs .versions.fresco.get()} " )
170+ implementation(" com.facebook.fresco:webpsupport:${ expoLibs .versions.fresco.get()} " )
165171 if (isWebpAnimatedEnabled) {
166172 // Animated webp support
167- implementation(" com.facebook.fresco:animated-webp:${ reactAndroidLibs .versions.fresco.get()} " )
173+ implementation(" com.facebook.fresco:animated-webp:${ expoLibs .versions.fresco.get()} " )
168174 }
169175 }
170176
0 commit comments