diff --git a/android/build.gradle b/android/build.gradle index cf167cf..e0c6dcf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,6 +11,17 @@ def safeExtGet(prop, fallback) { } android { + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { + namespace "com.agontuk.RNFusedLocation" + + def manifestFile = file("${projectDir}/src/main/AndroidManifest.xml") + def manifestContent = manifestFile.getText() + manifestContent = manifestContent.replaceAll("package=\"com.agontuk.RNFusedLocation\"", '') + + manifestFile.write(manifestContent) + } + compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)