Skip to content

Commit 24332e9

Browse files
authored
Fix Android embedding deprecation warning (Baseflow#90)
1 parent 171e795 commit 24332e9

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

.github/workflows/app_facing_package.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ jobs:
3232
# Make sure the stable version of Flutter is available
3333
- uses: subosito/flutter-action@v1
3434
with:
35-
channel: 'beta'
35+
channel: 'stable'
3636

37-
# Download all Flutter packages the geocoding depends on
37+
# Download all Flutter packages
3838
- name: Download dependencies
3939
run: flutter pub get
4040
working-directory: ${{env.source-directory}}
4141

4242
# Run Flutter Format to ensure formatting is valid
4343
- name: Run Flutter Format
44-
run: flutter format --set-exit-if-changed lib
44+
run: flutter format --set-exit-if-changed .
4545
working-directory: ${{env.source-directory}}
4646

4747
# Run Flutter Analyzer

geocoding/CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
## 2.0.3
2-
- Upgrade compileSdkVersion to 31
2+
3+
- Upgrades `compileSdkVersion` to `31` on Android.
4+
- Resolves Android embedding deprecation warning.
35

46
## 2.0.2
5-
- Migrate maven repository from jcenter to mavenCentral
7+
8+
- Migrate maven repository from jcenter to mavenCentral.
69

710
## 2.0.1
811

geocoding/android/src/main/java/com/baseflow/geocoding/GeocodingPlugin.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import androidx.annotation.NonNull;
55
import androidx.annotation.Nullable;
66
import io.flutter.embedding.engine.plugins.FlutterPlugin;
7-
import io.flutter.plugin.common.PluginRegistry.Registrar;
87

98
/**
109
* Plugin implementation that uses the new {@code io.flutter.embedding} package.
@@ -20,10 +19,11 @@ public final class GeocodingPlugin implements FlutterPlugin {
2019
* Registers a plugin implementation that uses the stable {@code io.flutter.plugin.common}
2120
* package.
2221
*
23-
* <p>Calling this automatically initializes the plugin. However plugins initialized this way
22+
* <p>Calling this automatically initializes the plugin. However, plugins initialized this way
2423
* won't react to changes in activity or context, unlike {@link GeocodingPlugin}.
2524
*/
26-
public static void registerWith(Registrar registrar) {
25+
@SuppressWarnings("deprecation")
26+
public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
2727
MethodCallHandlerImpl handler =
2828
new MethodCallHandlerImpl(new Geocoding(registrar.activeContext()));
2929
handler.startListening(registrar.messenger());

geocoding/example/android/app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727
android {
2828
compileSdkVersion 31
2929

30+
// Temporary add ndkVersion because GitHub CI is failing
31+
// TODO (mvanbeusekom): Remove once NDK version 23 is supported
32+
ndkVersion "22.1.7171670"
33+
3034
lintOptions {
3135
disable 'InvalidPackage'
3236
}

geocoding/example/android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
additional functionality it is fine to subclass or reimplement
77
FlutterApplication and put your custom class here. -->
88
<application
9-
android:name="io.flutter.app.FlutterApplication"
9+
android:name="${applicationName}"
1010
android:label="geocoding_example"
1111
android:icon="@mipmap/ic_launcher">
1212
<activity

geocoding/test/geocoding_test.dart

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import 'dart:async';
2-
31
import 'package:flutter_test/flutter_test.dart';
42
import 'package:geocoding/geocoding.dart';
5-
import 'package:geocoding_platform_interface/geocoding_platform_interface.dart';
63
import 'package:mockito/mockito.dart';
74
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
85

0 commit comments

Comments
 (0)