Skip to content

Commit 6f6fa30

Browse files
enedPaul DeMarco
authored and
Paul DeMarco
committed
[android] Migrate to AndroidX (#181)
* [android] Upgrade gradle plugin 3.3.0 * Migrate to AndroidX
1 parent 3d03d6c commit 6f6fa30

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.5.0
2+
* **Breaking change**. Migrate from the deprecated original Android Support
3+
Library to AndroidX. This shouldn't result in any functional changes, but it
4+
requires any Android apps using this plugin to [also
5+
migrate](https://developer.android.com/jetpack/androidx/migrate) if they're
6+
using the original support library.
7+
18
## 0.4.2+1
29
* Upgrade Android Gradle plugin to 3.3.0
310
* Refresh iOS build files

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ apply plugin: 'com.android.library'
2424
apply plugin: 'com.google.protobuf'
2525

2626
android {
27-
compileSdkVersion 27
27+
compileSdkVersion 28
2828

2929
defaultConfig {
3030
minSdkVersion 19
31-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
31+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3232
}
3333
lintOptions {
3434
disable 'InvalidPackage'
3535
}
3636
dependencies {
3737
// Required for local unit tests (JUnit 4 framework)
3838
testImplementation 'junit:junit:4.12'
39-
implementation 'com.android.support:support-compat:27.1.1'
39+
implementation 'androidx.core:core:1.0.1'
4040
//compile files('/home/paul/flutter/bin/cache/artifacts/engine/android-arm/flutter.jar')
4141
}
4242
sourceSets {

android/src/main/java/com/pauldemarco/flutterblue/FlutterBluePlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import android.content.pm.PackageManager;
2828
import android.os.Build;
2929
import android.os.ParcelUuid;
30-
import android.support.v4.app.ActivityCompat;
31-
import android.support.v4.content.ContextCompat;
3230
import android.util.Log;
3331

3432
import com.google.protobuf.ByteString;
@@ -40,6 +38,8 @@
4038
import java.util.Map;
4139
import java.util.UUID;
4240

41+
import androidx.core.app.ActivityCompat;
42+
import androidx.core.content.ContextCompat;
4343
import io.flutter.plugin.common.EventChannel;
4444
import io.flutter.plugin.common.EventChannel.EventSink;
4545
import io.flutter.plugin.common.EventChannel.StreamHandler;

example/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
28-
compileSdkVersion 27
28+
compileSdkVersion 28
2929

3030
lintOptions {
3131
disable 'InvalidPackage'
@@ -38,7 +38,7 @@ android {
3838
targetSdkVersion 27
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
41-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
41+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4242
}
4343

4444
buildTypes {
@@ -56,6 +56,6 @@ flutter {
5656

5757
dependencies {
5858
testImplementation 'junit:junit:4.12'
59-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
59+
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
60+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
6161
}

example/android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
android.enableJetifier=true
2+
android.useAndroidX=true
13
org.gradle.jvmargs=-Xmx1536M

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_blue
22
description: Bluetooth plugin for Flutter
3-
version: 0.4.2+1
3+
version: 0.5.0
44
author: Paul DeMarco <[email protected]>
55
homepage: https://github.com/pauldemarco/flutter_blue
66

0 commit comments

Comments
 (0)