diff --git a/android/build.gradle b/android/build.gradle index f429be8b..f1fe27fc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,6 +23,12 @@ def safeExtGet(prop, fallback) { } android { + // Compatibility for AGP v. <4.2/Gradle 8 + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() + if (agpVersion >= 7) { + namespace 'com.intercom.reactnative' + } + compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 34) defaultConfig { minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21) @@ -40,9 +46,12 @@ android { lintOptions { disable 'GradleCompatible' } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + + if (agpVersion < 8) { + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } } diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index c894b62c..0a0938ae 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - +