当尝试通过 Android Studio 在 iOS 模拟器上运行我的 Flutter 项目时,出现此错误:
Uncategorized (Xcode): Unable to find a device matching the provided destination specifier:
{ id:xxx }
The requested device could not be found because no available devices matched the request.
Available destinations for the "Runner" scheme:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:xxx, name:My Mac }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
Could not build the application for the simulator.
Error launching application on iPad (10th generation).
这在今天早些时候起作用了,我认为是升级 Flutter 导致了它的崩溃。我的所有 Flutter 项目都会发生同样的错误。
通过 Xcode 运行项目效果非常好!也可以通过Android Studio运行到真实设备上。
扑医生
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.1.1 24B91 darwin-arm64, locale en-NO)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[!] Android Studio (version unknown)
✗ Unable to determine Android Studio version.
[✓] IntelliJ IDEA Community Edition (version 2024.3)
[✓] VS Code (version 1.80.0)
[✓] Connected device (6 available)
[✓] Network resources
我尝试过的所有事情都没有成功
flutter upgrade/clean/get
pod deintegrate/install --repo-update
rm -R ~/Library/Developer/CoreSimulator/Caches
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
和 sudo xcodebuild -runFirstLaunch
flutter downgrade
flutter channel stable/master
+ flutter upgrade
我没有尝试过,但正在认真考虑的事情
旁注:似乎 Android studio 很难找到/列出 iOS 设备,如果我单击“刷新”,则需要很长时间才能出现打开的模拟器。
如果有人最近找到了解决方案,请联系!!!
当我完成上述所有操作但没有成功后,我重新启动了我的Mac,它突然工作了......