Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Android v1 embedding API #178

Closed
ben-xD opened this issue Sep 21, 2021 · 1 comment · Fixed by #328
Closed

Drop support for Android v1 embedding API #178

ben-xD opened this issue Sep 21, 2021 · 1 comment · Fixed by #328
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@ben-xD
Copy link
Contributor

ben-xD commented Sep 21, 2021

The Android v2 embedding API has been released at least 2 years ago, as the original V1 embedding API was deprecated 2 years ago: https://github.com/flutter/engine/blame/233a6e01fbb0f3cb407da7bee6817ccdcb6a9822/shell/platform/android/io/flutter/app/FlutterActivity.java#L19

The following comments were added in Ably Flutter in January 2020:

    // This static function is optional and equivalent to onAttachedToEngine. It supports the old
    // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
    // plugin registration via this function while apps migrate to use the new Android APIs
    // post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
    //
    // It is encouraged to share logic between onAttachedToEngine and registerWith to keep
    // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
    // depending on the user's project. onAttachedToEngine or registerWith must both be defined
    // in the same class.

It is unlikely any users still use this. If they do, they should upgrade to use the new embedding API, which is shown in https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

We should remove the unused public static void registerWith(Registrar registrar) method since we do not currently test it.

┆Issue is synchronized with this Jira Story by Unito

@ben-xD
Copy link
Contributor Author

ben-xD commented Oct 14, 2021

An example of the warning shown to users which use a package which only support the Android v1 embedding:

/opt/flutter/bin/flutter --no-color pub get
Running "flutter pub get" in final...                            1,142ms
The plugin `image_gallery_saver` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Process finished with exit code 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

Successfully merging a pull request may close this issue.

2 participants