致命错误:为 iOS 运行时找不到“Flutter/Flutter.h”文件

时间:2021-04-19 17:16:19

标签: ios xcode flutter dart

我有一个只使用 android 端的 flutter 应用程序。现在我想在 iPad 上运行它,但它抛出了这个错误:

Error output from Xcode build:
↳
    2021-04-19 11:31:26.233 xcodebuild[21793:154600]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
    Method:   -platform
    Thread:   <NSThread: 0x7f8196c6dc80>{number = 8, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2021-04-19 11:31:26.651 xcodebuild[21793:154569]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
    Method:   -platform
    Thread:   <NSThread: 0x7f8196a38370>{number = 5, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2021-04-19 11:31:26.835 xcodebuild[21793:154569]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
    Method:   -platform
    Thread:   <NSThread: 0x7f8196a38370>{number = 5, 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:
↳
    In file included from /Users/interno/Documents/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.m:7:
    /Users/interno/Documents/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

我已经尝试过的事情:

  • 运行 flutter clean
  • pod 安装
  • pod 更新
  • 删除“iOS”文件夹并运行“flutter create”

我需要做些什么来修复它?

1 个答案:

答案 0 :(得分:0)

您应该去 /Users/interno/Documents/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/ 删除文件夹 url_launcher 并运行 flutter pub dev