Skip to content

Commit

Permalink
Merge pull request #362 from charafau/androidx
Browse files Browse the repository at this point in the history
Added androidX support
  • Loading branch information
charafau authored Mar 28, 2019
2 parents 2cc5b03 + 466f2e1 commit 79803e1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
18 changes: 15 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
group 'com.flutter_webview_plugin'
version '1.0-SNAPSHOT'

def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of flutter_webview_plugin will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

Expand All @@ -21,10 +33,10 @@ allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
compileSdkVersion 28

defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// NOTE(jeffmikels): When targetSdkVersion or minSdkVersion is not set or < 4, gradle adds
// additional scary permissions such as WRITE_EXTERNAL_STORAGE and READ_PHONE_STATE.
minSdkVersion 16
Expand Down
8 changes: 4 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 27
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
Expand All @@ -42,7 +42,7 @@ flutter {
}

dependencies {
androidTestImplementation 'com.android.support:support-annotations:27.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'androidx.annotation:annotation:1.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
}
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

Expand All @@ -33,5 +33,5 @@ task clean(type: Delete) {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
gradleVersion = '4.10.2'
}
2 changes: 2 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=false

0 comments on commit 79803e1

Please sign in to comment.