|
| 1 | +--- |
| 2 | +title: Removal of v1 Android embedding Java APIs |
| 3 | +description: >- |
| 4 | + Learn how to account for the removal of the Android v1 embedding APIs. |
| 5 | +--- |
| 6 | + |
| 7 | +## Summary |
| 8 | + |
| 9 | +Android's v1 embedding has been removed in Flutter 3.29.0. |
| 10 | +This follows the deprecation described in |
| 11 | +[Android v1 embedding app and plugin creation deprecation][]. |
| 12 | +The following is a full list of classes removed. |
| 13 | + |
| 14 | +```text |
| 15 | +io.flutter.app.FlutterActivity |
| 16 | +io.flutter.app.FlutterActivityDelegate |
| 17 | +io.flutter.app.FlutterActivityEvents |
| 18 | +io.flutter.app.FlutterApplication |
| 19 | +io.flutter.app.FlutterFragmentActivity |
| 20 | +io.flutter.app.FlutterPlayStoreSplitApplication |
| 21 | +io.flutter.app.FlutterPluginRegistry |
| 22 | +
|
| 23 | +io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry |
| 24 | +io.flutter.embedding.engine.plugins.shim.ShimRegistrar |
| 25 | +
|
| 26 | +io.flutter.view.FlutterMain |
| 27 | +io.flutter.view.FlutterNativeView |
| 28 | +io.flutter.view.FlutterView |
| 29 | +``` |
| 30 | + |
| 31 | +If your project references any of the above classes, consult the following |
| 32 | +list for instructions on migration. |
| 33 | + |
| 34 | +* `io.flutter.app.FlutterActivity` was |
| 35 | + replaced with `io.flutter.embedding.android.FlutterActivity`. |
| 36 | +* `io.flutter.app.FlutterActivityDelegate` was |
| 37 | + replaced with `io.flutter.embedding.android.FlutterActivityAndFragmentDelegate`. |
| 38 | +* `io.flutter.app.FlutterActivityEvents` was removed. |
| 39 | +* `io.flutter.app.FlutterApplication` was removed. |
| 40 | + Flutter projects with custom `Application` implementations should |
| 41 | + instead extend the base `android.app.Application`. |
| 42 | +* `io.flutter.app.FlutterFragmentActivity` was |
| 43 | + replaced with `io.flutter.embedding.android.FlutterFragmentActivity`. |
| 44 | +* `io.flutter.app.FlutterPlayStoreSplitApplication` was |
| 45 | + replaced with `io.flutter.embedding.android.FlutterPlayStoreSplitApplication`. |
| 46 | +* `io.flutter.app.FlutterPluginRegistry` was removed, |
| 47 | + as it only served to let plugins support apps using the v1 embedding. |
| 48 | +* `io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry` was removed, |
| 49 | + as it only served to support let plugins support apps using the v1 embedding. |
| 50 | +* `io.flutter.embedding.engine.plugins.shim.ShimRegistrar` was removed, |
| 51 | + as it only served to support let plugins support apps using the v1 embedding. |
| 52 | +* `io.flutter.view.FlutterMain` was |
| 53 | + replaced by `io.flutter.embedding.engine.loader.FlutterLoader`. |
| 54 | +* `io.flutter.view.FlutterNativeView` was |
| 55 | + replaced by `io.flutter.embedding.android.FlutterView`. |
| 56 | +* `io.flutter.view.FlutterView` was |
| 57 | + replaced by `io.flutter.embedding.android.FlutterView`. |
| 58 | + |
| 59 | +[Android v1 embedding app and plugin creation deprecation]: /release/breaking-changes/android-v1-embedding-create-deprecation |
| 60 | + |
| 61 | +## Plugin authors |
| 62 | + |
| 63 | +Plugins should remove the `registerWith` method from |
| 64 | +their `FlutterPlugin` interface implementation: |
| 65 | + |
| 66 | +```java |
| 67 | +public static void registerWith(@NonNull io.flutter.plugin.common.PluginRegistry.Registrar registrar); |
| 68 | +``` |
| 69 | + |
| 70 | +For an example of this migration, |
| 71 | +check out the pull request to remove this method from the |
| 72 | +Flutter team-owned plugins: https://github.com/flutter/packages/pull/6494. |
| 73 | + |
| 74 | +## Timeline |
| 75 | + |
| 76 | +Landed in version: 3.28.0-0.1.pre<br> |
| 77 | +In stable release: 3.29 |
0 commit comments