ios - 如何修复此 Flutter iOS 构建错误?

标签 ios xcode flutter

我正在使用 flutter TTS 插件制作一个简单的文本转语音应用,并在我的实体 iPhone 和 iPad 上运行它进行调试。

我尝试用谷歌搜索它,flutter 的 github 存储库说我应该运行 flutter analyze,我也这样做了,但它说没有发现任何问题。所以我不确定该怎么做。我认为这是 xcode 的问题。

这是我的错误:

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    <module-includes>:1:9: note: in file included from <module-includes>:1:
    #import "Headers/flutter_tts-umbrella.h"
            ^
    /Users/ragz/Desktop/Desktop/Development/Projects/flutter/useless_app/ios/Pods/Target Support
    Files/flutter_tts/flutter_tts-umbrella.h:13:9: note: in file included from
    /Users/ragz/Desktop/Desktop/Development/Projects/flutter/useless_app/ios/Pods/Target Support
    Files/flutter_tts/flutter_tts-umbrella.h:13:
    #import "FlutterTtsPlugin.h"
            ^
    /Users/ragz/.pub-cache/hosted/pub.dartlang.org/flutter_tts-1.0.0/ios/Classes/FlutterTtsPlugin.h:1:9: error:
    'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    <unknown>:0: error: could not build Objective-C module 'flutter_tts'
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
    deployment target versions is 9.0 to 14.4.99. (in target 'flutter_tts' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
    deployment target versions is 9.0 to 14.4.99. (in target 'Flutter' from project 'Pods')

Could not build the precompiled application for the device.

Error launching application on iPad.

最佳答案

- Platform in ios/podfile you can use platform :ios, '10.0'
- If you are changing platform version in podfile than you have to also change version in AppFrameworkInfo.plist.
- Also change version in Deployment Target and Deployment Info of Runner.

- If not working than you have to try with this below commands using for uninstall and install again pods and Run.

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
flutter run

关于ios - 如何修复此 Flutter iOS 构建错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66508867/

相关文章:

ios - cURL 请求有效,但不是等效的 NSURLSession 请求

ios - 快速显示 UIAlertController 中的错误消息数组

iOS Rich 推送通知在某些设备中不显示图像

ios - ECGraph无法在设备上运行,但可以在模拟器上运行

ios - 苹果Mapkit : Map doesn't start with my given coordinates

ios - 尝试在 swift 项目中使用 cocoa pod 安装 Purelayout

iPhone : Textfields and NSNumberFormatter

flutter - 插件 `flutter_webview_plugin` 使用已弃用的 Android 嵌入版本

flutter - Flutter Infinite滚动:如何触发每个滚动一个

sqlite - Flutter:在我的应用程序中哪里放置 sqflite 代码?