无法在Flutter下运行第一个项目

3
Mac with Mojave
Flutter installed
Flutter Doctor passed all the tests

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
[✓] Connected device (2 available)

我启动了IntelliJ IDE,并点击创建新项目。

我选择了Android模拟器:Nexus 5S,并成功打开了模拟器。

我点击绿色箭头运行,但是出现了以下错误信息:

════════════════════════════════════════════════════════════════════════════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning 
Profile for your project by:
  1- Open the Flutter project's Xcode target with
       open ios/Runner.xcworkspace
  2- Select the 'Runner' project in the navigator then the 'Runner' target
     in the project settings
  3- In the 'General' tab, make sure a 'Development Team' is selected. 
     You may need to:
         - Log in with your Apple ID in Xcode first
         - Ensure you have a valid unique Bundle ID
         - Register your device with your Apple Developer Account
         - Let Xcode automatically provision a profile for your app
  4- Build or run your project again
  5- Trust your newly created Development Certificate on your iOS device
     via Settings > General > Device Management > [your new certificate] > Trust

For more information, please visit:
  https://developer.apple.com/library/content/documentation/IDEs/Conceptual/
  AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Finished with error: No development certificates available to code sign app for device deployment

有什么想法吗?

1
看起来它正在尝试在没有有效证书的 iOS 设备上运行?(Flutter Doctor 表示有 2 个设备已连接) - Tom
当然,我把我的iPhone连接到了我的Mac上。我断开了我的iPhone,现在它可以运行了。如果您将此转换为答案,我会给您信用。 - EastsideDev
done, please mark as answer. - Tom
1个回答

4

看起来它试图在没有有效证书的iOS设备上运行。Flutter医生称有2个设备已连接。如果您连接了iOS设备到电脑,请尝试断开连接,这样Flutter就不会尝试使用它而不是模拟器。


4
即使我已经连接到模拟器,但我仍然遇到相同的错误。 - Rishikrishna

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接