Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FabricExample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ android {
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"

// Detox-specific additions to pro-guard
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
Expand Down
5 changes: 5 additions & 0 deletions FabricExample/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ rnsDebugLogsEnabled=true

# Use this property to enable V5-specific code
rnsGammaEnabled=true

# Opt out of built-in kotlin and new DSL behavior that ships with AGP 9.
# Starting from AGP 10.x these opt outs will be removed.
android.builtInKotlin=false
android.newDsl=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
28 changes: 21 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,22 @@ if (isRunningInContextOfScreensRepo()) {
apply plugin: "com.facebook.react"
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

def shouldEnableAgpFallback() {
def agpMajorVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
if (agpMajorVersion <= 8) {
return true
}

def propertyVal = providers.gradleProperty("android.builtInKotlin").orNull
def isBuiltInKotlinEnabled = propertyVal != null ? propertyVal.toBoolean() : true

return !isBuiltInKotlinEnabled
}

if (shouldEnableAgpFallback()) {
apply plugin: 'kotlin-android'
}

def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
Expand Down Expand Up @@ -170,16 +185,15 @@ android {
}
sourceSets.main {
ext.androidResDir = "src/main/res"
java {
srcDirs += [
"src/fabric/java",
]
kotlin {
directories.add("src/fabric/java")
}
res {
if (safeExtGet(['compileSdkVersion', 'compileSdk'], rnsDefaultCompileSdkVersion) >= 33) {
srcDirs = ["${androidResDir}/base", "${androidResDir}/v33"]
directories.add("${androidResDir}/base")
directories.add("${androidResDir}/v33")
} else {
srcDirs = ["${androidResDir}/base"]
directories.add("${androidResDir}/base")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists