From 8e75de4a65838f7649344401c4d4e0c4d40a7d94 Mon Sep 17 00:00:00 2001 From: Mason Le <43195241+MasonLe2497@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:06:10 +0700 Subject: [PATCH] feat(android): add support namespace and rn 0.73 --- android/build.gradle | 21 +++++++++++++++++++++ android/src/main/AndroidManifestNew.xml | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 android/src/main/AndroidManifestNew.xml diff --git a/android/build.gradle b/android/build.gradle index c8f7fd44..ec5eb709 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,7 +15,28 @@ def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } +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 +} + android { + if(supportsNamespace()){ + namespace = "com.reactnativecommunity.webview" + sourceSets { + main { + manifest.srcFile "src/main/AndroidManifestNew.xml" + } + } + } compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { diff --git a/android/src/main/AndroidManifestNew.xml b/android/src/main/AndroidManifestNew.xml new file mode 100644 index 00000000..12d7c746 --- /dev/null +++ b/android/src/main/AndroidManifestNew.xml @@ -0,0 +1,3 @@ + +