简体   繁体   English

Flutter 在 Xcode 上运行,但不在 VS Code 上

[英]Flutter run on Xcode but don't on VS Code

I'm trying to run my app in a real iOS device within VS Code but I'am having an error about provisioning profile, I already set my provisioning profile to automatic and also set my development team, everything works in Xcode but not in VS Code.我正在尝试在 VS Code 中的真实 iOS 设备中运行我的应用程序,但我在配置配置文件时遇到错误,我已经将配置配置文件设置为自动并设置了我的开发团队,一切都在 Xcode 中运行,但在 VS 中没有代码。

Here is the error:这是错误:

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 version 11.3 Xcode 11.3版

I already check automatically manage signing我已经检查了自动管理签名

在此处输入图像描述


SOLUTION解决方案

  1. run "flutter clean" on flutter project在 flutter 项目上运行“flutter clean”
  2. in xcode -> build -> clean在 xcode -> 构建 -> 清洁
  3. run "flutter build bundle"运行“颤振构建包”

I'm not using my mac right now, so I can't give you exact instructions;我现在不使用我的 mac,所以我不能给你确切的说明; but please try opening your app with Xcode, and look for the provisioning profile, and try to use automatically manage signing.但是请尝试使用 Xcode 打开您的应用程序,并查找配置文件,并尝试使用自动管理签名。

If I remember correctly it should be at general > signing.如果我没记错的话,应该是一般 > 签名。 You might have to click the target, or the runner somewhere at the left side of Xcode.您可能需要单击 Xcode 左侧某处的目标或跑步者。 Then try to run your app via VS Code again after doing the changes.然后在进行更改后再次尝试通过 VS Code 运行您的应用程序。

These steps work fine这些步骤工作正常

  1. run "flutter clean"运行“扑通干净”
  2. on flutter project in xcode -> build -> clean在 xcode 中的 flutter 项目 -> 构建 -> 清理
  3. run "flutter build bundle"运行“颤振构建包”

if you are running your code in real device.如果您在真实设备上运行代码。 That error will we occur.我们会发生那个错误。 I have solved this issue by add the test device to your apple developer test device list.我已经通过将测试设备添加到您的苹果开发人员测试设备列表中解决了这个问题。

I had the same issue and solved it with these steps:我遇到了同样的问题并通过以下步骤解决了它:

  1. Delete the app from your iPhone从 iPhone 中删除应用程序
  2. Open Xcode -> click Product -> Clean Build Folder (see screenshot)打开 Xcode -> 点击产品 -> 清理构建文件夹(见截图)
  3. Open VScode terminal and run command flutter clean && flutter run打开 VScode 终端并运行命令flutter clean && flutter run xCode 产品>清洁构建文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter iOS 应用程序不适用于 xcode 模拟器 - 如何修复它? - Flutter iOS app don't run for xcode simulator -how fix it? Flutter 背景 iOS 通知在 XCode 或 TestFlight 中不起作用 - Flutter background iOS notification don't work in XCode or TestFlight 升级 Flutter 3.0 后无法运行 iOS xcode - After upgrade Flutter 3.0 can't run iOS xcode Xcode 8.1(和8.2 beta)不会在助手视图中更新代码 - Xcode 8.1 (and 8.2 beta) don't update code in assistant view flutter 项目无法在 xcode 上运行 - flutter project failed to run on xcode Xcode不要打开MyProject - Xcode Don't Open MyProject 在XCode - > Build Settings - > Code Signing中“不编码符号”值的目的是什么? - What is the purpose of “Don't code sign” value in XCode -> Build Settings -> Code Signing? Xcode 10:代码签名标识中的不代码签名选项在哪里 - Xcode 10: Where is the don't code sign option in Code Signing Identity 在 flutter 的 vs 代码中未检测到物理设备 (iPad),但在 Xcode 中检测到并正常调试 - Physical device (iPad) not detected in vs code for flutter but detected and working proper for debugging in Xcode 如何保持 ios 模拟器应用程序文档路径相同,不要更改每次运行 xcode 项目 - how to keep ios simulator app document path same,don't change every run xcode project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM