flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.14k stars 27.44k forks source link

[tool_crash] _TypeError: (#0 currentPackageConfig (package:flutter_tools/src/dart/package_map.dart:16:56)) #154686

Closed zh4ngx closed 1 month ago

zh4ngx commented 1 month ago

Command

flutter --no-color run --machine --track-widget-creation --device-id=chrome --start-paused --dart-define=flutter.inspector.structuredErrors=true lib/main.dart

Steps to Reproduce

  1. Upgrade to Flutter 3.24
  2. Run app created under Flutter 3.22
  3. See error

Logs

_TypeError: (#0 currentPackageConfig (package:flutter_tools/src/dart/package_map.dart:16:56))

#0      currentPackageConfig (package:flutter_tools/src/dart/package_map.dart:16:56)
#1      _loadDwdsDirectory (package:flutter_tools/src/isolated/devfs_web.dart:1234:45)
#2      WebAssetServer.start (package:flutter_tools/src/isolated/devfs_web.dart:270:15)
<asynchronous suspension>
#3      WebDevFS.create (package:flutter_tools/src/isolated/devfs_web.dart:860:22)
<asynchronous suspension>
#4      ResidentWebRunner.run.<anonymous closure> (package:flutter_tools/src/isolated/resident_web_runner.dart:328:19)
<asynchronous suspension>
#5      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:24)
<asynchronous suspension>
[✓] Flutter (Channel stable, 3.24.1, on NixOS 24.11 (Vicuna) 6.10.6, locale en_US.UTF-8)
    • Flutter version 3.24.1 on channel stable at /nix/store/wp7165dbyc8w8ng10qaxkfsrrr9rc5hs-flutter-wrapped-3.24.1-sdk-links
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision nixpkgs000 (), 1970-01-01 00:00:00
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /home/andy/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/to/linux-android-setup for more details.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = google-chrome-stable

[✓] Linux toolchain - develop for Linux desktop
    • clang version 18.1.8
    • cmake version 3.29.6
    • ninja version 1.12.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2024.1)
    • Android Studio at /nix/store/44kgdhc2wbrjz4wfqcwpdfnxkw87kk75-android-studio-stable-2024.1.1.13-unwrapped
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • NixOS 24.11 (Vicuna) 6.10.6
    • Chrome (web)    • chrome • web-javascript • Google Chrome 128.0.6613.84

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

! Doctor found issues in 1 category.

Flutter Application Metadata

Type: app Version: 1.0.0+1 Material: true Android X: false Module: false Plugin: false Android package: null iOS bundle identifier: null Creation channel: stable Creation framework version: nixpkgs000000000000000000000000000000000

Plugins

cloud_firestore-5.2.1 cloud_firestore_web-4.1.1 cloud_functions-5.0.4 cloud_functions_web-4.9.11 firebase_app_check-0.3.0+4 firebase_app_check_web-0.1.2+12 firebase_auth-5.1.4 firebase_auth_web-5.12.5 firebase_core-3.3.0 firebase_core_web-2.17.4 flutter_inappwebview-6.0.0 flutter_inappwebview_android-1.0.13 flutter_inappwebview_ios-1.0.13 flutter_inappwebview_macos-1.0.11 flutter_inappwebview_web-1.0.8 path_provider-2.1.4 path_provider_android-2.2.10 path_provider_foundation-2.4.0 path_provider_linux-2.2.1 path_provider_windows-2.3.0 url_launcher-6.3.0 url_launcher_android-6.3.9 url_launcher_ios-6.3.1 url_launcher_linux-3.2.0 url_launcher_macos-3.2.0 url_launcher_web-2.3.3 url_launcher_windows-3.1.2

darshankawar commented 1 month ago

Closing as duplicate of https://github.com/flutter/flutter/issues/153238

github-actions[bot] commented 1 month ago

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.