8000 Latest main branch unable to use flutter cmd (likely due to native_asset_cli version conflict) · Issue #167694 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Latest main branch unable to use flutter cmd (likely due to native_asset_cli version conflict) #167694

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

Closed
hellohuanlin opened this issue Apr 24, 2025 · 4 comments
Labels
r: solved Issue is closed as solved tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@hellohuanlin
Copy link
Contributor
hellohuanlin commented Apr 24, 2025

Steps to reproduce

I pulled my branch today, and try to call flutter build ipa on a project, and got this error:

huanlin@huanlin-mac ipa_proj % flutter build ipa
Building flutter tool...
Resolving dependencies... 
The current Dart SDK version is 3.8.0-1.0.dev.

Because flutter_tools depends on native_assets_cli >=0.15.0-0 which requires SDK version
  >=3.8.0-260.0.dev <4.0.0, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Try using the Dart SDK version: 3.8.0. See https://dart.dev/get-dart.
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
  1. I had engine dev env working as of this morning before i pull main.
  2. Then I pulled latest code
  3. Then I did gclient sync -D
  4. Then I tried to run flutter build ipa on my test project, and see this error

Flutter Doctor output

Interestingly, flutter doctor also didn't work with the same message

But flutter -v prints the version:

The current Dart SDK version is 3.8.0-1.0.dev.
@hellohuanlin hellohuanlin changed the title Latest main branch unable to call flutter build ipa likely due to natiev_asset_cli version Latest main branch unable to use flutter cmd (likely due to natiev_asset_cli version conflict) Apr 24, 2025
@hellohuanlin hellohuanlin added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 24, 2025
@hellohuanlin
Copy link
Contributor Author
hellohuanlin commented Apr 24, 2025

Oh it may be that I also have to build the engine. Let me run et and report back! It didn't work

@hellohuanlin hellohuanlin changed the title Latest main branch unable to use flutter cmd (likely due to natiev_asset_cli version conflict) Latest main branch unable to use flutter cmd (likely due to native_asset_cli version conflict) Apr 24, 2025
@maheshj01 maheshj01 added the in triage Presently being triaged by the triage team label Apr 25, 2025
@maheshj01
Copy link
Member
maheshj01 commented Apr 25, 2025

Hey @hellohuanlin, Please share the output of flutter doctor -v. I tried to rperoduce this on latest master channel and I was not able to reproduce the issue. Also are you seeing this on a newly created flutter app ?

mahesh@MacBook-Pro-81 web_embed % flutterm build ipa --release --no-codesign
Resolving dependencies... 
Downloading packages... 
> async 2.13.0 (was 2.12.0)
> fake_async 1.3.3 (was 1.3.2)
> leak_tracker 11.0.1 (was 10.0.8)
> leak_tracker_flutter_testing 3.0.10 (was 3.0.9)
> leak_tracker_testing 3.0.2 (was 3.0.1)
  lints 5.1.1 (6.0.0 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  vector_math 2.1.4 (2.1.5 available)
> vm_service 15.0.0 (was 14.3.1)
Changed 6 dependencies!
3 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to
device.
Archiving com.example.web-embed...
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        50.2s
Xcode archive done.                                         76.5s
✓ Built build/ios/archive/Runner.xcarchive (156.2MB)

[!] App Settings Validation
    • Version Number: 1.0.0
    • Build Number: 1
    • Display Name: Web Embed
    • Deployment Target: 13.0
    • Bundle Identifier: com.example.web-embed
    ! Your application still contains the default "com.example" bundle identifier.

[!] App Icon and Launch Image Assets Validation
    ! App icon is set to the default placeholder icon. Replace with unique icons.
    ! Launch image is set to the default placeholder icon. Replace with unique launch image.

To update the settings, please refer to https://flutter.dev/to/ios-deploy
flutter doctor
Codesigning disabled with --no-codesign, skipping IPA.
mahesh@MacBook-Pro-81 web_embed % flutterm doctor -v
Could not load custom device from config index 0: Expected enabled to be a boolean.
[!] Flutter (Channel master, 3.32.0-1.0.pre.244, on macOS 15.4 24E248 darwin-arm64, locale en-US) [16.2s]
    • Flutter version 3.32.0-1.0.pre.244 on channel master at /Users/mahesh/Development/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5574a51f56 (2 hours ago), 2025-04-24 19:34:07 -0400
    • Engine revision 5574a51f56
    • Dart version 3.9.0 (build 3.9.0-52.0.dev)
    • DevTools version 2.45.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git"
      directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.2s]
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Emulator version 35.2.10.0 (build_id 12414864) (CL:N/A)
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/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.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [1,587ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [124ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [123ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 21.0.5+-12932927-b750.29)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1) [122ms]
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.96.2) [17ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (2 available) [6.8s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.4 24E248 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.265

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

! Doctor found issues in 1 category.

@maheshj01 maheshj01 added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 25, 2025
@hellohuanlin
Copy link
Contributor Author

@maheshj01 As I said flutter doctor prints the same error for me.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 25, 2025
@hellohuanlin
Copy link
Contributor Author
hellohuanlin commented Apr 25, 2025

With help from @jason-simmons, this is what we did to fix it, for future reference:

First, we did a sanity check:

bin/cache/dart-sdk/bin/dart --version
Dart SDK version: 3.8.0-1.0.dev (dev) (Thu Jan 16 12:02:35 2025 -0800) on "macos_arm64"
git rev-parse HEAD
f01be78706671c7c42b22e27a22f4d4ae99089b6

We notice the dart SDK version was old. So we tried deleting the cache to refetch:

huanlin@huanlin-mac flutter % rm -rf bin/cache 
huanlin@huanlin-mac flutter % bin/dart --version
Downloading Darwin arm64 Dart SDK from Flutter engine bb2d34126cc8161dbe4a1bf23c925e48b732f670...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  204M  100  204M    0     0  45.7M      0  0:00:04  0:00:04 --:--:-- 49.6M
Dart SDK version: 3.8.0-1.0.dev (dev) (Thu Jan 16 12:02:35 2025 -0800) on "macos_arm64"

Still not working. Then we tried to update upstream/master

huanlin@huanlin-mac flutter % git merge-base HEAD upstream/master

bb2d34126cc8161dbe4a1bf23c925e48b732f670
huanlin@huanlin-mac flutter % git merge-base HEAD origin/master

e87b202160c6434bb9d9d0d9306eedafa39ec1b0
huanlin@huanlin-mac flutter %
git fetch upstream
remote: Enumerating objects: 1518, done.
remote: Counting objects: 100% (1154/1154), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 1518 (delta 1123), reused 1091 (delta 1091), pack-reused 364 (from 3)
Receiving objects: 100% (1518/1518), 905.97 KiB | 3.65 MiB/s, done.
Resolving deltas: 100% (1173/1173), completed with 445 local objects.
From github.com:flutter/flutter
huanlin@huanlin-mac flutter % git log upstream/master
warning: refname 'upstream/master' is ambiguous.
commit f01be78706671c7c42b22e27a22f4d4ae99089b6 (HEAD -> main, upstream/master)
Author: zhongliugo <zhongliu88889@gmail.com>
Date:   Fri Apr 25 09:53:17 2025 -0700
huanlin@huanlin-mac flutter % git merge-base HEAD upstream/master
warning: refname 'upstream/master' is ambiguous.
f01be78706671c7c42b22e27a22f4d4ae99089b6

Then remove cache again, and this time it worked:

huanlin@huanlin-mac flutter % rm -rf bin/cache  
huanlin@huanlin-mac flutter % bin/dart --version
warning: refname 'upstream/master' is ambiguous.
Downloading Darwin arm64 Dart SDK from Flutter engine f01be78706671c7c42b22e27a22f4d4ae99089b6...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  194M  100  194M    0     0  56.6M      0  0:00:03  0:00:03 --:--:-- 56.6M
Dart SDK version: 3.9.0-55.0.dev (dev) (Thu Apr 24 21:03:09 2025 -0700) on "macos_arm64"

This line in above log is odd:

warning: refname 'upstream/master' is ambiguous.

It turned out that it's because I had a local branch called upstream/master, which confuses git.

git branch -m upstream/master something_else
git merge-base HEAD upstream/master
f01be78706671c7c42b22e27a22f4d4ae99089b6

Then everything worked now

@maheshj01 maheshj01 added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r: solved Issue is closed as solved tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

2 participants
0