我对 flutter 还比较陌生,我正在尝试使用
flutter run
在 android studio 中运行模拟器来运行该应用程序。
我一直遇到这个错误,但无法摆脱它:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find io.flutter:x86_64_debug:1.0.0-36335019a8eab588c3c2ea783c618d90505be233.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/flutter/x86_64_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_64_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://repo.maven.apache.org/maven2/io/flutter/x86_64_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_64_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://plugins.gradle.org/m2/io/flutter/x86_64_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_64_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://jitpack.io/io/flutter/x86_64_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_64_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://jcenter.bintray.com/io/flutter/x86_64_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_64_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
Required by:
project :app
> Could not find io.flutter:x86_debug:1.0.0-36335019a8eab588c3c2ea783c618d90505be233.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/flutter/x86_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://repo.maven.apache.org/maven2/io/flutter/x86_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://plugins.gradle.org/m2/io/flutter/x86_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://jitpack.io/io/flutter/x86_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
- https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-36335019a8eab588c3c2ea783c618d90505be233/x86_debug-1.0.0-36335019a8eab588c3c2ea783c618d90505be233.pom
Required by:
project :app
flutter doctor 输出:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-x64, locale en-EG)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
✗ Flutter requires Xcode 14 or higher.
Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Community Edition (version 2023.3.4)
[✓] VS Code (version 1.93.1)
[✓] Connected device (3 available)
[✓] Network resources
如有任何帮助,我们将不胜感激!
PS。我使用的是 MacOS,并使用 Flutter 附带的正确 Dart SDK
试试这个:
flutter channel stable && flutter upgrade
flutter clean
flutter run