Skip to content

Commit 9936fa7

Browse files
CopilotCarGuo
andcommitted
Fix Android Gradle configuration for React Native 0.74 compatibility
Co-authored-by: CarGuo <[email protected]>
1 parent e28a007 commit 9936fa7

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

android/app/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ react {
3131
// nodeExecutableAndArgs = ["node"]
3232

3333
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
34-
entryFile = "index.js"
34+
entryFile = file("index.js")
3535

3636
// A list of extra flags to pass to the 'bundle' commands.
3737
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
@@ -81,13 +81,12 @@ def jscFlavor = 'org.webkit:android-jsc:+'
8181
/**
8282
* Whether to enable the Hermes VM.
8383
*
84-
* This should be set on project.ext.react and mirrored here. If it is not set
85-
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
86-
* and the benefits of using Hermes will therefore be sharply reduced.
84+
* This should be set in the react {} block above and mirrored here.
8785
*/
88-
def enableHermes = project.ext.react.get("enableHermes", false);
86+
def enableHermes = true // This should match react.enableHermes
8987

9088
android {
89+
namespace "com.gsygithubapp"
9190
compileSdkVersion rootProject.ext.compileSdkVersion
9291

9392
compileOptions {

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
gradlePluginPortal()
1616
}
1717
dependencies {
18-
classpath("com.android.tools.build:gradle:8.2.2")
18+
classpath("com.android.tools.build:gradle:8.1.4")
1919
classpath("com.facebook.react:react-native-gradle-plugin")
2020
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2121
}

android/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919

2020
android.useAndroidX=true
2121
android.enableJetifier=true
22+
23+
# React Native New Architecture
24+
newArchEnabled=false
25+
hermesEnabled=true

0 commit comments

Comments
 (0)