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

Remove references to deprecated v1 Android embedding #38

Open
reidbaker opened this issue Aug 8, 2024 · 3 comments
Open

Remove references to deprecated v1 Android embedding #38

reidbaker opened this issue Aug 8, 2024 · 3 comments

Comments

@reidbaker
Copy link

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:

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: flutter/engine#52022

@reidbaker
Copy link
Author

flutter/engine#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")

@labaxter
Copy link

labaxter commented Mar 5, 2025

external_app_launcher no longer compiles with flutter version 3.29.

Please remove the v1 imbedding code in external_app_launder. This issue was opened 8 months ago. I think there has been ample time for this to fixed. If I want to compile my app that uses external_app_launcher I would have to downgrade flutter to 2.24.

Here are the compile errors:

/home/lab/.pub-cache/hosted/pub.dev/external_app_launcher-4.0.1/android/src/main/java/com/example/launchexternalapp/LaunchexternalappPlugin.java:9: error: cannot find symbol
import io.flutter.plugin.common.PluginRegistry.Registrar;
                                              ^
  symbol:   class Registrar
  location: interface PluginRegistry
/home/lab/.pub-cache/hosted/pub.dev/external_app_launcher-4.0.1/android/src/main/java/com/example/launchexternalapp/LaunchexternalappPlugin.java:30: error: cannot find symbol
  public static void registerWith(Registrar registrar) {
                                  ^
  symbol:   class Registrar
  location: class LaunchexternalappPlugin
2 errors

For reference, here is my flutter doctor output:

flutter doctor -v
[✓] Flutter (Channel stable, 3.29.0, on Debian GNU/Linux 12 (bookworm) 6.1.0-31-amd64, locale en_US.UTF-8) [157ms]
    • Flutter version 3.29.0 on channel stable at /home/lab/devel/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 35c388afb5 (3 weeks ago), 2025-02-10 12:48:41 -0800
    • Engine revision f73bfc4522
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,219ms]
    • Android SDK at /home/lab/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /home/lab/Android/Sdk
    • Java binary at: /home/lab/devel/android-studio/jbr/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
    • All Android licenses accepted.

[✓] Chrome - develop for the web [91ms]
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [253ms]
    • Debian clang version 14.0.6
    • cmake version 3.25.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2024.2) [90ms]
    • Android Studio at /home/lab/devel/android-studio
    • Flutter plugin version 83.0.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[✓] VS Code (version 1.97.2) [11ms]
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available) [190ms]
    • Pixel 8 Pro (mobile) • 41231FDJG0049H • android-arm64  • Android 15 (API 35)
    • Linux (desktop)      • linux          • linux-x64      • Debian GNU/Linux 12 (bookworm) 6.1.0-31-amd64
    • Chrome (web)         • chrome         • web-javascript • Google Chrome 133.0.6943.98

[✓] Network resources [228ms]
    • All expected network resources are available.

• No issues found!

@geekruchika
Copy link
Contributor

Hi All,
I have fixed this in the latest version
external_app_launcher: ^4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants