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 @@ + +