Skip to content

Commit 298aa32

Browse files
authored
Update build.gradle
Load Android Gradle Plugin conditionally
1 parent ef70ac3 commit 298aa32

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

android/build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
apply plugin: 'com.android.library'
22

33
buildscript {
4-
repositories {
5-
maven { url "https://maven.google.com" }
6-
jcenter()
7-
google()
8-
}
4+
// The Android Gradle plugin is only required when opening the android folder stand-alone.
5+
// This avoids unnecessary downloads and potential conflicts when the library is included as a
6+
// module dependency in an application project.
7+
if (project == rootProject) {
8+
repositories {
9+
maven { url "https://maven.google.com" }
10+
jcenter()
11+
google()
12+
}
913

10-
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.4.1'
12-
}
14+
dependencies {
15+
classpath 'com.android.tools.build:gradle:3.5.1'
16+
}
17+
}
1318
}
1419

1520
def safeExtGet(prop, fallback) {

0 commit comments

Comments
 (0)