Skip to content

Commit 5597b39

Browse files
feat(android): add support for AGP 8 (oblador#98)
1 parent 65cc45a commit 5597b39

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/react-native-performance/android/build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ android {
5050
compileSdkVersion safeExtGet('compileSdkVersion', 31)
5151
buildToolsVersion safeExtGet('buildToolsVersion', "31.0.0")
5252

53+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
54+
if (agpVersion >= 7) {
55+
namespace 'com.oblador.performance'
56+
}
57+
5358
defaultConfig {
5459
minSdkVersion safeExtGet('minSdkVersion', 21)
5560
targetSdkVersion safeExtGet('targetSdkVersion', 31)
@@ -73,9 +78,11 @@ android {
7378
}
7479
}
7580

76-
compileOptions {
77-
sourceCompatibility JavaVersion.VERSION_1_8
78-
targetCompatibility JavaVersion.VERSION_1_8
81+
if (agpVersion < 8) {
82+
compileOptions {
83+
sourceCompatibility JavaVersion.VERSION_1_8
84+
targetCompatibility JavaVersion.VERSION_1_8
85+
}
7986
}
8087
}
8188

0 commit comments

Comments
 (0)