Skip to content

flutter channel shows incorrect Android embedding v2 warning #96642

@creativecreatorormaybenot

Description

When I run flutter channel stable (for example) in my root user directory, I see the following warning:

Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2.

This, however, makes no sense at all because my root user directory is not a Flutter project. It does, however, contain an android directory (which has nothing to do with the android directories you will find in Flutter projects).

Steps to Reproduce

  1. cd to a directory that contains a folder named android
  2. flutter channel stable (or a different channel if you are already on stable)
Click to expand full logs
D:\>flutter channel stable
╔════════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available!                                     ║
║                                                                            ║
║ To update to the latest version, run "flutter upgrade".                    ║
╚════════════════════════════════════════════════════════════════════════════╝


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  No `D:\android\AndroidManifest.xml` file
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Switching to flutter channel 'stable'...

Proposal

Before checking if there is an AndroidManifest.xml in an android directory and if that directory exists, check if the working directory is a Flutter project.

Steps

  1. Check if the current working directory is a Flutter project → check for a pubspec.yaml file.
  2. Check if there is an android directory.
  3. Check for the AndroidManifest.xml file.

Currently, step 2. is missing.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Fluttergood first issueRelatively approachable for first-time contributorsplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions