From a87e535713df574f2fec635999c648a3610279c5 Mon Sep 17 00:00:00 2001 From: CodeMak1r Date: Wed, 23 Jul 2025 11:59:30 +0800 Subject: [PATCH] feat: support Android Gradle Plugin namespace --- android/build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/android/build.gradle b/android/build.gradle index b8cea50..dba5663 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,6 +23,19 @@ def isNewArchitectureEnabled() { return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" } +def supportsNamespace() { + def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') + def major = parsed[0].toInteger() + def minor = parsed[1].toInteger() + + // Namespace support was added in 7.3.0 + if (major == 7 && minor >= 3) { + return true + } + + return major >= 8 +} + apply plugin: 'com.android.library' if (isNewArchitectureEnabled()) { apply plugin: 'com.facebook.react' @@ -31,6 +44,9 @@ if (isNewArchitectureEnabled()) { android { compileSdkVersion safeExtGet('compileSdkVersion', 23) buildToolsVersion safeExtGet('buildToolsVersion', "25.0.0") + if (supportsNamespace()) { + namespace "com.github.wumke.RNExitApp" + } defaultConfig { minSdkVersion safeExtGet('minSdkVersion',16)