flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

[ENH]: Remove references to deprecated v1 Android embedding

Open reidbaker opened this issue 1 year ago • 5 comments

Remove references to deprecated v1 Android embedding

To ensure this plugin will work with users running the next stable version of Flutter remove references to the v1 embedding.

The v1 embedding was deprecated around 6 and a half years ago. In Flutter 3.22, the Flutter tool dropped support for building v1 apps entirely. Flutter plans to delete version one of it's Android embedding in the next stable release, per https://medium.com/flutter/whats-new-in-flutter-3-22-fbde6c164fe3 (in the "Removal of v1 Android embedding" section).

When that deletion happens, any apps using plugins that still have references to the removed classes will fail to build when updating to the next stable version (probably Flutter 3.26).

As a part of this deprecation, the Flutter Android team is doing community outreach by filing bugs and submitting some pull requests to update plugins to minimize the impact this removal has on the community.

Some example PRs:

  • Flutter team maintained plugins: https://github.com/flutter/packages/pull/6494
  • android_alarm_manager_plus https://github.com/fluttercommunity/plus_plugins/pull/2864

Consequences:

  • This change should have no impact on users of this plugin that are building apps using the v2 embedding (we don't have a percentage to share, but this is the vast majority of users).
  • It will remove support for users that are still using the v1 embedding on versions of Flutter older than 3.22.

If this change doesn't land, this plugin will instead be broken for all apps building on the next stable version of Flutter and beyond.

Is there a way to support both v1 and v2 embedding apps in the next stable version of Flutter?

No.

This is the PR where we are removing the deprecated engine classes: https://github.com/flutter/engine/pull/52022

Is your feature request related to a problem? Please describe. Apps using this plugin and future versions of flutter will not be able to compile.

Describe the solution you'd like see above

Describe alternatives you've considered N/A

reidbaker avatar Aug 08 '24 15:08 reidbaker

Do you think you should be able to do a Pull Request ?

Larpoux avatar Aug 08 '24 15:08 Larpoux

Do you think you should be able to do a Pull Request ?

No there are more than 100 identified plugins in the top 1000 and I do not have time to do a pull request for each of them.

reidbaker avatar Aug 08 '24 16:08 reidbaker

I was running into this issue today, much to my frustration. I suppose I'll have to downgrade to an older Flutter version until this gets resolved.

sveinbjornt avatar Aug 08 '24 19:08 sveinbjornt

I expect to work on Flutter Sound tomorrow. I must work on (#1063). If I have some time I will look after what I can do for this issue. But this kind of work can be done by anybody. No need to be an expert in Flutter Sound internal. I would really be grateful if other people work on Flutter Sound maintenance.

Larpoux avatar Aug 08 '24 19:08 Larpoux

I was running into this issue today, much to my frustration. I suppose I'll have to downgrade to an older Flutter version until this gets resolved.

The issue you are having is most likely not this issue. The pull request to remove the classes has not been merged. For this to be your issue you must be using flutter_sound as a dependency and using a custom flutter engine with the classes removed (which would only happen if you were a flutter plugin developer also working on this type of issue).

reidbaker avatar Aug 08 '24 20:08 reidbaker

https://github.com/flutter/engine/pull/52022 has been merged. Users targeting Flutter master and beta/stable releases after (but not including) 3.27 will fail to compile if the plugin has references any v1 embedding classes.

To aid in identifying these classes here is a search query you can run in github on your repo.

("io.flutter.view.FlutterMain" OR "io.flutter.view.FlutterNativeView" OR "io.flutter.view.FlutterView" OR "io.flutter.embedding.engine.plugins.shim" OR "io.flutter.app" OR "PluginRegistry.Registrar")

reidbaker avatar Oct 24 '24 14:10 reidbaker

Any chance to have a Pull Request ?

Larpoux avatar Oct 24 '24 14:10 Larpoux

yes you are near the top of our list

reidbaker avatar Oct 29 '24 16:10 reidbaker