简体   繁体   English

Flutter 无法仅在物理 iOs 设备中构建和运行 iOS 应用程序

[英]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对不起,如果这是一个迟到的答案,但在这些情况下帮助我的是

  1. Run "flutter clean" in the terminal在终端中运行“flutter clean”
  2. In some cases, it'll help to clear your project's files cache...can be done by opening your command shortcut on vscode(shift+command+p or shift+control+p) then search for "Clear Editor History"在某些情况下,清除项目的文件缓存会有所帮助...可以通过在 vscode(shift+command+p 或 shift+control+p) 上打开命令快捷方式然后搜索“清除编辑器历史记录”来完成
  3. Assuming you have a Mac and pods installed and you have updated any pubsec packages, an optional additional step that has worked for the most part is to delete your "Podfile.lock" file under your Flutter Project iOS folder, assuming it has already been generated upon previous builds, then close your IDE.假设你已经安装了 Mac 和 pods 并且你已经更新了任何 pubsec 包,一个可选的额外步骤是在你的 Flutter Project iOS 文件夹下删除你的“Podfile.lock”文件,假设它已经生成在以前的版本上,然后关闭您的 IDE。 Then in your terminal, navigate to your cd <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.

相关问题 无法在物理设备上构建 IOS 应用程序 - Unable to build IOS app on physical device 无法在物理设备上构建iOS应用 - Not able build ios app on physical device Flutter:- 无法使用 flutter 运行 iOS 命令构建 iOS 应用程序。 ** 构建失败 ** - Flutter :- Failed to build iOS app using flutter run iOS command . ** BUILD FAILED ** 无法在 iOS 仿真器或物理设备上构建 Flutter 应用程序 - 虽然在 Android 上工作正常 - Cannot build Flutter app on iOS emulator or physical device - works fine on Android though XCode13.4 运行 flutter 项目未能构建 iOS 应用程序 - XCode13.4 run flutter project failed to build iOS app 物理设备的kivy-ios构建失败(iPad Pro 10.5) - kivy-ios Build Failed with physical device (iPad Pro 10.5) 在使用物理 iOS 设备的 Flutter 应用程序中使用 FirebaseAuth 登录时出错 - Error signing in using FirebaseAuth in a Flutter app using a physical iOS device Flutter:无法构建 iOS 应用程序“ARCHIVE FAILED”,为设备归档时遇到错误 - Flutter : Failed to build iOS app "ARCHIVE FAILED",Encountered error while archiving for device 在 IOS 设备上运行 Flutter Android 构建的应用程序 - Run Flutter Android Built App on IOS Device Flutter - 无法在 Android Studio 上构建 iOS 应用程序 - Flutter - Failed to build iOS app on Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM