[英]Flutter Failed to build and run iOS app only in physical iOs device
i'm trying build and run a "Counter App" (the default app when you create a flutter project), i can run the project in android and iOs simulators, on physics devices works in android perfectly but when i run the project in vscode i got an error.我正在尝试构建并运行“计数器应用程序”(创建 flutter 项目时的默认应用程序),我可以在 android 和 iOs 模拟器中运行该项目,在物理设备上在 android 中完美运行,但是当我在 vscode 中运行该项目时我有一个错误。
The output when i run the project is:我运行项目时的输出是:
Downloading libimobiledevice...
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: FSB8SU7R5X
Xcode build done. 16.0s
Failed to build iOS app
Error output from Xcode build:
↳
2021-06-30 22:16:22.665 xcodebuild[43211:324927] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 281a05c1d363c04aed318582d30866afde2dd04c was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7faac3b77c10>
Method: -platform
Thread: <NSThread: 0x7faac0c416c0>{number = 2, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2021-06-30 22:16:22.867 xcodebuild[43211:324928] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 281a05c1d363c04aed318582d30866afde2dd04c was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7faac3b77c10>
Method: -platform
Thread: <NSThread: 0x7faac3b69fe0>{number = 6, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2021-06-30 22:16:22.991 xcodebuild[43211:324928] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 281a05c1d363c04aed318582d30866afde2dd04c was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7faac3b77c10>
Method: -platform
Thread: <NSThread: 0x7faac3b69fe0>{number = 6, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
Xcode's output:
↳
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file '/Users/jromero/Library/Developer/Xcode/DerivedData/Runner-flkwoylypfarbpbtarvmoxfypnce/Build/Products/Debug-iphoneos/Runner.app'
Could not build the precompiled application for the device.
Error launching application on iPhone.
Exited (sigterm)
I tried cleaning the project (flutter clean, get the packages and run again) but there is not working :c.我尝试清理项目(flutter clean,获取包并再次运行)但没有工作:c。
Flutter doctor output:颤振医生输出:
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en)
• Flutter version 2.2.2 at /Users/jromero/development/flutter
• Framework revision d79295af24 (3 weeks ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/jromero/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/jromero/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Community Edition (version 2021.1.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 57.0.5
• Dart plugin version 211.7665
[✓] VS Code (version 1.57.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.23.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114
• No issues found!
Any help is welcome c:欢迎任何帮助 c:
Sorry if this is a bit of a late answer but what has helped me in these situations is to对不起,如果这是一个迟到的答案,但在这些情况下帮助我的是
<pathToProject>/<ios>
important that you navigate to your iOS subfolder and run pod install --repo-update
然后在您的终端中,导航到您的 cd <pathToProject>/<ios>
重要您导航到您的 iOS 子文件夹并运行pod install --repo-update
-all the best -祝一切顺利
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.