【问题标题】:Flutter run on Xcode but don't on VS CodeFlutter 在 Xcode 上运行,但不在 VS Code 上
【发布时间】:2020-04-27 07:38:10
【问题描述】:

我正在尝试在 VS Code 中的真实 iOS 设备中运行我的应用程序,但我在配置配置文件时遇到错误,我已经将配置配置文件设置为自动,并且还设置了我的开发团队,一切都在 Xcode 中运行,但是不在 VS Code 中。

这是错误:

No Provisioning Profile was found for your project's Bundle Identifier or your 
device. You can create a new Provisioning Profile for your project in Xcode for 
your team 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

It's also possible that a previously installed app with the same Bundle 
Identifier was signed with a different certificate.

For more information, please visit:
 https://flutter.dev/setup/#deploy-to-ios-devices

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
2020-01-09 10:18:45.163 ios-deploy[43201:5238881] [ !! ] Error 0xe8008015: A valid provisioning profile for this executable was not found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
Could not install build/ios/iphoneos/Runner.app on 2fd298b64f27b47f0917050a9f7ec70cdc98f033.
Try launching Xcode and selecting "Product > Run" to fix the problem:
 open ios/Runner.xcworkspace

Xcode 11.3 版

我已经勾选了自动管理签名


解决方案

  1. 在 Flutter 项目上运行“flutter clean”
  2. 在 xcode 中 -> 构建 -> 清理
  3. 运行“flutter build bundle”

【问题讨论】:

    标签: ios xcode flutter


    【解决方案1】:

    这些步骤工作正常

    1. 运行“flutter clean”
    2. 关于 xcode 中的颤振项目 -> 构建 -> 清理
    3. 运行“flutter build bundle”

    【讨论】:

    • 这对我有用。最后。现在我可以在我的 iOS 设备上运行应用程序时在 VSCode 中调试 Flutter。真是救命啊!!!
    【解决方案2】:

    我现在没有使用我的 mac,所以我不能给你确切的说明;但请尝试使用 Xcode 打开您的应用,查找配置文件,并尝试使用自动管理签名。

    如果我没记错的话,应该是一般 > 签名。您可能需要单击 Xcode 左侧某处的目标或跑步者。然后在进行更改后再次尝试通过 VS Code 运行您的应用。

    【讨论】:

    • 嗨,感谢您的回答,我更新了帖子以显示我已经检查了该选项,但我不确定这是否是我应该做的,因为我仍然有同样的错误
    • 这很奇怪。您是否尝试过通过 xcode 清理项目。在 xcode 中有类似“干净构建”操作的东西,可以在上方工具栏的某处找到。或者也许在项目文件夹中运行flutter clean命令并再试一次?
    • 谢谢,这就是解决方案。 Fluuter 清洁和构建 -> 清洁
    【解决方案3】:

    如果您在真实设备中运行代码。我们会发生那个错误。我已通过将测试设备添加到您的 Apple 开发人员测试设备列表来解决此问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-10
      • 2017-01-10
      • 2020-09-01
      • 2015-07-10
      • 1970-01-01
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多