Skip to content

Commit

Permalink
Merge pull request innoveit#594 from SaeedZhiany/patch-1
Browse files Browse the repository at this point in the history
Load Android Gradle Plugin conditionally
  • Loading branch information
marcosinigaglia authored Mar 5, 2020
2 parents e62937c + a18fa0f commit 4206090
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
buildscript {
repositories {
jcenter()
google()
}
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
dependencies {
classpath("com.android.tools.build:gradle:3.6.1")
}
}
}
apply plugin: 'com.android.library'

Expand All @@ -16,7 +21,6 @@ def safeExtGet(prop, fallback) {

android {
compileSdkVersion safeExtGet("compileSdkVersion", 29)
buildToolsVersion safeExtGet("buildToolsVersion", "28.0.3")

defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 19)
Expand Down

0 comments on commit 4206090

Please sign in to comment.