Skip to content

Commit 4c17eeb

Browse files
committed
Load Android Gradle Plugin conditionally
1 parent b7c722a commit 4c17eeb

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

android/build.gradle

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ def _targetSdkVersion = safeExtGet('targetSdkVersion', 28)
1414
def _minSdkVersion = safeExtGet('minSdkVersion', 16)
1515

1616
buildscript {
17-
repositories {
18-
google()
19-
jcenter()
20-
}
21-
dependencies {
22-
classpath 'com.android.tools.build:gradle:3.4.1'
17+
// The Android Gradle plugin is only required when opening the android folder stand-alone.
18+
// This avoids unnecessary downloads and potential conflicts when the library is included as a
19+
// module dependency in an application project.
20+
if (project == rootProject) {
21+
repositories {
22+
google()
23+
jcenter()
24+
}
25+
26+
dependencies {
27+
classpath("com.android.tools.build:gradle:3.5.3")
28+
}
2329
}
2430
}
2531

0 commit comments

Comments
 (0)