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

flutter create -t package warns about deprecated Android embeddings #116320

Closed
Hixie opened this issue Dec 1, 2022 · 25 comments
Closed

flutter create -t package warns about deprecated Android embeddings #116320

Hixie opened this issue Dec 1, 2022 · 25 comments
Labels
a: quality A truly polished experience P2 Important issues not at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Hixie
Copy link
Contributor

Hixie commented Dec 1, 2022

Run flutter create -t package testpackage on a Linux machine with no devices attached:

ianh@burmese:~/dev$ flutter create -t package testpackage
Downloading Linux x64 Dart SDK from Flutter engine 441229a95cd97f1eaf999923a3d987db67709f90...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  247M  100  247M    0     0  19.8M      0  0:00:12  0:00:12 --:--:-- 20.9M
Building flutter tool...
Downloading package sky_engine...                                  296ms
Downloading flutter_patched_sdk tools...                           204ms
Downloading flutter_patched_sdk_product tools...                   196ms
Downloading linux-x64 tools...                                   1,499ms
Downloading linux-x64/font-subset tools...                          72ms
Creating project testpackage...
Running "flutter pub get" in testpackage...                        943ms
Resolving dependencies in testpackage...
+ async 2.10.0
+ boolean_selector 2.1.1
+ characters 1.2.1
+ clock 1.1.1
+ collection 1.17.0
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5
+ lints 2.0.1
+ matcher 0.12.13
+ material_color_utilities 0.2.0
+ meta 1.8.0
+ path 1.8.2
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16
+ vector_math 2.1.4
Changed 23 dependencies in testpackage!
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Wrote 13 files.

All done!
Your package code is in testpackage/lib/testpackage.dart
ianh@burmese:~/dev$ 

Notice in particular the part that says:

This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

This machine has the following configuration:

ianh@burmese:~/dev$ flutter doctor -v
[✓] Flutter (Channel master, 3.6.0-13.0.pre.24, on Ubuntu 22.04.1 LTS 5.15.0-47-generic, locale C.UTF-8)
    • Flutter version 3.6.0-13.0.pre.24 on channel master at /home/ianh/dev/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision 4878f26ab0 (19 minutes ago), 2022-11-30 23:18:19 -0500
    • Engine revision 441229a95c
    • Dart version 2.19.0 (build 2.19.0-444.0.dev)
    • DevTools version 2.20.0

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/ianh/Android/Sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

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

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1
    • cmake version 3.22.1
    • ninja version 1.8.2
    • pkg-config version 0.29.2

[✓] Android Studio (version 2020.3)
    • Android Studio at /home/ianh/bin/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] IntelliJ IDEA Community Edition (version 2022.1)
    • IntelliJ at /home/ianh/bin/idea-IC-221.5921.22
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.1 LTS 5.15.0-47-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 107.0.5304.121

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
ianh@burmese:~/dev$ 
@Hixie Hixie added tool Affects the "flutter" command-line tool. See also t: labels. a: quality A truly polished experience P2 Important issues not at the top of the work list labels Dec 1, 2022
@Hixie
Copy link
Contributor Author

Hixie commented Dec 14, 2022

I see this warning in all kinds of places. I just checked out package:rfw for example, ran flutter pub get in the wasm example (which doesn't have an Android anything), and it told me "This app is using a deprecated version of the Android embedding." and created a java plugin registrant.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 14, 2022

Subsequently running flutter run -d linux in that directory also showed me the message.

@Anas35
Copy link
Contributor

Anas35 commented Dec 20, 2022

Creating a new packages on windows on latest channel beta too warns about it.

flutter doctor -v
[√] Flutter (Channel beta, 3.7.0-1.2.pre, on Microsoft Windows [Version 10.0.19045.2364], locale en-IN)
    • Flutter version 3.7.0-1.2.pre on channel beta at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c29b09b878 (8 hours ago), 2022-12-19 18:30:12 -0600
    • Engine revision 8c99b0feaf
    • Dart version 2.19.0 (build 2.19.0-444.2.beta)
    • DevTools version 2.20.0
[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\moham\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] IntelliJ IDEA Community Edition (version 2022.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.4
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.72.1)
    • VS Code at C:\Users\moham\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.54.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2364]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 108.0.5359.99
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available
flutter create -t package test
flutter create -t package test
Creating project test...
Running "flutter pub get" in test...
Resolving dependencies in test... (2.1s)
+ async 2.10.0
+ boolean_selector 2.1.1
+ characters 1.2.1
+ clock 1.1.1
+ collection 1.17.0
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5 (0.6.6 available)
+ lints 2.0.1
+ matcher 0.12.13 (0.12.14 available)
+ material_color_utilities 0.2.0
+ meta 1.8.0
+ path 1.8.2 (1.8.3 available)
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16 (0.4.17 available)
+ vector_math 2.1.4
Changed 23 dependencies in test!
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Wrote 13 files.

All done!
Your package code is in test\lib\test.dart

verbose output for above command exceed GitHub character limits.


Same command without running pub, it doesn't warns.

flutter create -t package test --no-pub -v
[  +18 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +81 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] c29b09b8782b39b1678bc9c861f40902086fb7c8
[        ] executing: [C:\src\flutter/] git tag --points-at c29b09b8782b39b1678bc9c861f40902086fb7c8
[ +104 ms] Exit code 0 from: git tag --points-at c29b09b8782b39b1678bc9c861f40902086fb7c8
[   +2 ms] 3.7.0-1.2.pre
[  +21 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +64 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[   +1 ms] origin/beta
[   +1 ms] executing: [C:\src\flutter/] git ls-remote --get-url origin
[  +68 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +90 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref HEAD
[  +73 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] beta
[  +57 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +83 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +8 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +87 ms] Creating project test...
[ +118 ms] Wrote 13 files.
[   +1 ms]
           All done!
[   +1 ms] Your package code is in test\lib\test.dart
[  +14 ms] "flutter create" took 459ms.
[ +258 ms] ensureAnalyticsSent: 251ms
[   +1 ms] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0

@eximius313
Copy link

Same problem here:
flutter create --template=package --project-name=foo .
flutter test
gives:

This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

@LeonManolo

This comment was marked as duplicate.

@eximius313
Copy link

Plain dart package works fine (dart create -t package foo)

@4e6anenk0
Copy link

It's true for me too. I encountered the same problem when I tried to create a package for my new project. I would like to use a package for the packages directory within my app project

flutter doctor -v
flutter doctor -v
[✓] Flutter (Channel stable, 3.7.7, on Fedora Linux 37 (Workstation Edition)
    6.1.14-200.fc37.x86_64, locale uk_UA.UTF-8)
    • Flutter version 3.7.7 on channel stable at
      /home/yppppl/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2ad6cd72c0 (19 hours ago), 2023-03-08 09:41:59 -0800
    • Engine revision 1837b5be5f
    • Dart version 2.19.4
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /home/yppppl/Android/Sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

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

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2022.1)
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.60.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora Linux 37 (Workstation
      Edition) 6.1.14-200.fc37.x86_64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 110.0.5481.177

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

After running the command: flutter create --template=package test

output
Creating project test2...
Running "flutter pub get" in test2...
Resolving dependencies in test2... (1.1s)
+ async 2.10.0
+ boolean_selector 2.1.1
+ characters 1.2.1 (1.3.0 available)
+ clock 1.1.1
+ collection 1.17.0 (1.17.1 available)
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5 (0.6.7 available)
+ lints 2.0.1
+ matcher 0.12.13 (0.12.14 available)
+ material_color_utilities 0.2.0
+ meta 1.8.0 (1.9.0 available)
+ path 1.8.2 (1.8.3 available)
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16 (0.4.18 available)
+ vector_math 2.1.4
Changed 23 dependencies in test2!
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate
this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Wrote 13 files.

All done!
Your package code is in test2/lib/test2.dart

Does this mean I need to edit every package I create? My goal was to use package-based separation

@saltedpotatos
Copy link
Contributor

@4e6anenk0

When creating a package, using flutter create -t package test --no-pub avoids the android embedding bug

@Bishop19
Copy link

@4e6anenk0

When creating a package, using flutter create -t package test --no-pub avoids the android embedding bug

True, but when you add android, the warning is there

@Paolo-N

This comment was marked as duplicate.

@LeonManolo
Copy link

What is the difference between "dart create --template=package-simple " and "flutter create --template=package "? The one starting with flutter also creates android, ios, web folders but that shouldnt be the case if Im not wrong:
https://docs.flutter.dev/development/packages-and-plugins/developing-packages#step-1-create-the-package

@NebulaFox
Copy link

NebulaFox commented Mar 22, 2023

The embedding warning turned into an error when trying to run tests. In my specific case, if you include device_info_plus which requires android embedding v2, the tests will not run.

I also wondered if I should be using plugin instead of package.

Just an update: since my tests don't actually use device_info_plus as they are just unit tests I can run flutter test --no-pub to get round the problem.

@AlexLomm
Copy link

Should the advice be followed as suggested by the warning message?

This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

@tamas-p
Copy link

tamas-p commented Mar 30, 2023

Flutter 3.3.10 = OK, no issue
Flutter 3.7.0 = NOK, warning + folders like android, macos, windows, linux are created (that were not created at 3.3.10)
...
Flutter 3.7.8 = NOK, warning + folders like android, macos, windows, linux are created (that were not created at 3.3.10)

Results with 3.3.10 and 3.7.0:
tamas@munkasmokus:/tmp/test$ fvm use 3.3.10 --force
Project now uses Flutter [3.3.10]
tamas@munkasmokus:/tmp/test$ f create -t package test_3_3_10
Creating project test_3_3_10...
Running "flutter pub get" in test_3_3_10...                      1,159ms
Wrote 13 files.

All done!
Your package code is in test_3_3_10/lib/test_3_3_10.dart
tamas@munkasmokus:/tmp/test$ ls test_3_3_10/
analysis_options.yaml  CHANGELOG.md  lib  LICENSE  pubspec.lock  pubspec.yaml  README.md  test  test_3_3_10.iml
tamas@munkasmokus:/tmp/test$ fvm use 3.7.0 --force
Project now uses Flutter [3.7.0]
tamas@munkasmokus:/tmp/test$ f create -t package test_3_7_0
Creating project test_3_7_0...
Running "flutter pub get" in test_3_7_0...
Resolving dependencies in test_3_7_0...
+ async 2.10.0 (2.11.0 available)
+ boolean_selector 2.1.1
+ characters 1.2.1 (1.3.0 available)
+ clock 1.1.1
+ collection 1.17.0 (1.17.1 available)
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5 (0.6.7 available)
+ lints 2.0.1
+ matcher 0.12.13 (0.12.15 available)
+ material_color_utilities 0.2.0 (0.3.0 available)
+ meta 1.8.0 (1.9.1 available)
+ path 1.8.2 (1.8.3 available)
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16 (0.5.0 available)
+ vector_math 2.1.4
Changed 23 dependencies in test_3_7_0!
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Wrote 13 files.

All done!
Your package code is in test_3_7_0/lib/test_3_7_0.dart
tamas@munkasmokus:/tmp/test$ ls test_3_7_0/
analysis_options.yaml  android  CHANGELOG.md  ios  lib  LICENSE  linux  macos  pubspec.lock  pubspec.yaml  README.md  test  test_3_7_0.iml  windows

@claudiooliveira

This comment was marked as duplicate.

@SilkeSiip
Copy link

Has there been any update on this?

@lihenggui
Copy link

Any ideas on how to solve this issue? I am currently using Android Studio to create a package, but it will constantly warn me about the outdated Android Embedding.

[√] Flutter (Channel stable, 3.7.11, on Microsoft Windows [Version 10.0.22621.1485], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
[√] Android Studio (version 2022.1)
[√] Android Studio (version 2022.3)
[√] VS Code (version 1.77.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

@tamas-p
Copy link

tamas-p commented Apr 14, 2023

Any ideas on how to solve this issue? I am currently using Android Studio to create a package, but it will constantly warn me about the outdated Android Embedding.

I used fvm to be on 3.3.10 when creating a package.

@marcov-dart
Copy link

Any ideas on how to solve this issue? I am currently using Android Studio to create a package, but it will constantly warn me about the outdated Android Embedding.

flutter create --template=package is creating lots of crap it shouldn't for some reason.

I compared it to one of my previously created packages and just deleted the android, ios, linux, macos and windows folders + the .idea folder, the .iml file and the dartpad folder from the .dart_tool folder.

Worked for me, hope it works for you too

@rddewan
Copy link

rddewan commented Apr 19, 2023

same issue when using the flutter create --template=package demo. I cant run the unit test on my package , deleting android, folder solves it but not sure if that's the correct way to fix it. Hope flutter can release some hot fix on it

@marcov-dart
Copy link

I am pretty sure it shouldn't have any of the platform folders in the first place. Only plugin packages have those. And when you create a plugin package with flutter create --template=plugin demo it doesn't get those folders until you add platform support with flutter create --template=plugin --platforms android,ios .
And the plugin template by the way doesn't have the deprecated android embedding problem.

auto-submit bot pushed a commit that referenced this issue Apr 29, 2023
`package` template should not create platform folders. This happen cause by default all platforms are supported and tools didn't distinguish between package and other template, which makes all platforms are true for below code,
https://github.com/flutter/flutter/blob/d186792c00f61149916f685e2975300342f64749/packages/flutter_tools/lib/src/project.dart#L374-L380

fixes: #119844 which make #116320 makes invalid. As for why tools created deprecated `Android Embedding`, `appManifestFile` does not exist for `package` template, which make below code to trigger,
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/project.dart#L768-L770

This does not happen with `module` and `plugin` as it have specific condition check for them. I try to reproduce it with `app` template but didn't succeed
@andrewkolos
Copy link
Contributor

Closing as fixed by #125292

@arthurgiani
Copy link

arthurgiani commented May 1, 2023

Closing as fixed by #125292

Thanks @andrewkolos.

Since I already started a package with a lot of work using the old template (created by flutter 3.7.1), how should I proceed? create a new template and migrate all the files?

@andrewkolos
Copy link
Contributor

Since I already started a package with a lot of work using the old template (created by flutter 3.7.1), how should I proceed? create a new template and migrate all the files?

#125292 was only merged into the master branch, so it is not yet available in the stable or beta branches.

In the meantime, it should be sufficient to delete the unnecessary platform folders (including android) in your project.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: quality A truly polished experience P2 Important issues not at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests