From 113ad8f8ffc281c0b726cd7ba33b1a4f411886cb Mon Sep 17 00:00:00 2001 From: asaarnak Date: Sat, 4 Mar 2023 14:07:38 +0200 Subject: [PATCH 1/3] bump roboelectric version --- .../google_maps_flutter_android/CHANGELOG.md | 4 ++++ .../google_maps_flutter_android/android/build.gradle | 2 +- .../google_maps_flutter_android/pubspec.yaml | 2 +- packages/url_launcher/url_launcher_android/CHANGELOG.md | 4 ++++ .../url_launcher/url_launcher_android/android/build.gradle | 2 +- packages/url_launcher/url_launcher_android/pubspec.yaml | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index 0607df422e8..097e9e21822 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.9 + +* Bump RoboElectric dependency to 4.4.1 to support AndroidX. + ## 2.4.8 * Fixes compilation warnings. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle index 96c0bd4febd..fef368e278b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle @@ -41,7 +41,7 @@ android { testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'androidx.test:core:1.2.0' - testImplementation "org.robolectric:robolectric:4.3.1" + testImplementation "org.robolectric:robolectric:4.4.1" } compileOptions { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 2e02e0253b7..a6c6814f84e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.4.8 +version: 2.4.9 environment: sdk: ">=2.14.0 <3.0.0" diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index f577d68cacc..adda41360f7 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.25 + +* Bump RoboElectric dependency to 4.4.1 to support AndroidX. + ## 6.0.24 * Updates links for the merge of flutter/plugins into flutter/packages. diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 63d81249ed8..d066fde7b17 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -51,5 +51,5 @@ dependencies { testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'androidx.test:core:1.0.0' - testImplementation 'org.robolectric:robolectric:4.3' + testImplementation 'org.robolectric:robolectric:4.4.1' } diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 0dedffd5eec..e8f19681edc 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.0.24 +version: 6.0.25 environment: sdk: ">=2.14.0 <3.0.0" From c9d2ab072c849aedabf9014ce948c17c534711ca Mon Sep 17 00:00:00 2001 From: asaarnak Date: Sat, 4 Mar 2023 14:23:48 +0200 Subject: [PATCH 2/3] update examples --- .../example/android/gradle.properties | 2 +- .../url_launcher_android/example/android/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle.properties b/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle.properties index c6c9db00b99..b1a5ba51330 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle.properties +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx4G android.enableR8=true android.useAndroidX=true -android.enableJetifier=true +android.enableJetifier=false diff --git a/packages/url_launcher/url_launcher_android/example/android/gradle.properties b/packages/url_launcher/url_launcher_android/example/android/gradle.properties index e5611e4c7fa..d0448f163e4 100644 --- a/packages/url_launcher/url_launcher_android/example/android/gradle.properties +++ b/packages/url_launcher/url_launcher_android/example/android/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx4G android.useAndroidX=true -android.enableJetifier=true +android.enableJetifier=false android.enableR8=true From 212a38a2fdc1d5131f0c4255751e9ec1a6fb8168 Mon Sep 17 00:00:00 2001 From: asaarnak Date: Fri, 10 Mar 2023 01:22:33 +0200 Subject: [PATCH 3/3] [google_maps_flutter_android] Fix native_test after RoboElectric bump --- .../flutter/plugins/googlemaps/GoogleMapControllerTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java index 52576962ba8..a24a2bc7e71 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java @@ -14,6 +14,7 @@ import android.content.Context; import android.os.Build; +import android.os.Looper; import androidx.activity.ComponentActivity; import androidx.test.core.app.ApplicationProvider; import com.google.android.gms.maps.GoogleMap; @@ -31,6 +32,7 @@ import org.mockito.MockitoAnnotations; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; +import org.robolectric.Shadows; import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) @@ -104,6 +106,7 @@ public void InvalidateMapAfterMethodCalls() throws InterruptedException { verify(mapView, never()).invalidate(); argument.getValue().onMapLoaded(); + Shadows.shadowOf(Looper.getMainLooper()).idle(); verify(mapView).invalidate(); } } @@ -127,6 +130,7 @@ public void InvalidateMapOnceAfterMethodCall() throws InterruptedException { verify(mapView, never()).invalidate(); argument.getValue().onMapLoaded(); + Shadows.shadowOf(Looper.getMainLooper()).idle(); verify(mapView).invalidate(); }