diff --git a/android/build.gradle b/android/build.gradle index fcf5027f..8a96c2d6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,6 +1,18 @@ 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() @@ -8,7 +20,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.2' } } @@ -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 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3a963017..fe1e79cb 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -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' @@ -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' } diff --git a/example/android/build.gradle b/example/android/build.gradle index 6c6a9df7..3b7e4ba2 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.2' } } @@ -33,5 +33,5 @@ task clean(type: Delete) { } task wrapper(type: Wrapper) { - gradleVersion = '2.14.1' + gradleVersion = '4.10.2' } diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 8bd86f68..09913f7d 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1 +1,3 @@ org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=false \ No newline at end of file