Skip to content

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

Closed

Description

@Hixie

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$ 

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: qualityA truly polished experience
    P2Important issues not at the top of the work list
    on Dec 1, 2022
  2. Hixie commented on Dec 14, 2022

    @Hixie
    ContributorAuthor

    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.

  3. Hixie commented on Dec 14, 2022

    @Hixie
    ContributorAuthor

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

  4. Anas35 commented on Dec 20, 2022

    @Anas35
    Contributor

    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
    
  5. eximius313 commented on Feb 20, 2023

    @eximius313

    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
    
  6. LeonManolo commented on Mar 7, 2023

    @LeonManolo
  7. eximius313 commented on Mar 7, 2023

    @eximius313

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

  8. 4e6anenk0 commented on Mar 9, 2023

    @4e6anenk0

    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

  9. saltedpotatos commented on Mar 14, 2023

    @saltedpotatos
    Contributor

    @4e6anenk0

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

  10. Bishop19 commented on Mar 17, 2023

    @Bishop19

    @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

  11. Paolo-N commented on Mar 19, 2023

    @Paolo-N
  12. LeonManolo commented on Mar 22, 2023

    @LeonManolo

    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

  13. HeliumEnd commented on Mar 22, 2023

    @HeliumEnd

    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.

  14. 3 remaining items

  15. SilkeAtSiip commented on Apr 12, 2023

    @SilkeAtSiip

    Has there been any update on this?

  16. lihenggui commented on Apr 12, 2023

    @lihenggui

    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
    
  17. tamas-p commented on Apr 14, 2023

    @tamas-p

    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.

  18. marcov-dart commented on Apr 15, 2023

    @marcov-dart

    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

  19. rddewan commented on Apr 19, 2023

    @rddewan

    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

  20. marcov-dart commented on Apr 19, 2023

    @marcov-dart

    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.

  21. andrewkolos commented on Apr 29, 2023

    @andrewkolos
    Contributor

    Closing as fixed by #125292

  22. arthurgiani commented on May 1, 2023

    @arthurgiani

    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?

  23. andrewkolos commented on May 1, 2023

    @andrewkolos
    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.

  24. github-actions commented on May 15, 2023

    @github-actions

    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.

  25. locked as resolved and limited conversation to collaborators on May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencetoolAffects 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