Repository navigation
flutter create -t package warns about deprecated Android embeddings #116320
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencetoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
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 [email protected]: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$
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencetoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
Hixie commentedon Dec 14, 2022
I see this warning in all kinds of places. I just checked out
package:rfwfor example, ranflutter pub getin 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 commentedon Dec 14, 2022
Subsequently running
flutter run -d linuxin that directory also showed me the message.Anas35 commentedon Dec 20, 2022
Creating a new packages on windows on latest channel
betatoo warns about it.flutter doctor -v
flutter create -t package test
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
eximius313 commentedon Feb 20, 2023
Same problem here:
flutter create --template=package --project-name=foo .flutter testgives:
LeonManolo commentedon Mar 7, 2023
eximius313 commentedon Mar 7, 2023
Plain dart package works fine (
dart create -t package foo)4e6anenk0 commentedon Mar 9, 2023
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
packagesdirectory within my app projectflutter doctor -v
After running the command:
flutter create --template=package testoutput
Does this mean I need to edit every package I create? My goal was to use package-based separation
saltedpotatos commentedon Mar 14, 2023
@4e6anenk0
When creating a package, using
flutter create -t package test --no-pubavoids the android embedding bugBishop19 commentedon Mar 17, 2023
True, but when you add android, the warning is there
Paolo-N commentedon Mar 19, 2023
LeonManolo commentedon Mar 22, 2023
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
HeliumEnd commentedon 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
plugininstead ofpackage.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-pubto get round the problem.3 remaining items
SilkeAtSiip commentedon Apr 12, 2023
Has there been any update on this?
lihenggui commentedon Apr 12, 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.
tamas-p commentedon Apr 14, 2023
I used fvm to be on 3.3.10 when creating a package.
marcov-dart commentedon Apr 15, 2023
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 commentedon 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 itmarcov-dart commentedon Apr 19, 2023
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.
fix package template create platform folders (#125292)
andrewkolos commentedon Apr 29, 2023
Closing as fixed by #125292
arthurgiani commentedon May 1, 2023
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 commentedon May 1, 2023
#125292 was only merged into the master branch, so it is not yet available in the
stableorbetabranches.In the meantime, it should be sufficient to delete the unnecessary platform folders (including
android) in your project.github-actions commentedon May 15, 2023
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 -vand a minimal reproduction of the issue.