前几天在升级FLutter版本后在flutter build ios 出现问题:
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 1,0s
Running Xcode clean... 0,9s
Starting Xcode build...
Xcode build done 1,4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug ===
In file included from /Users/jeroen/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.m:5:
/Users/jeroen/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone 6.
Flutter/Flutter.h not found ,起初我以为是flutter 环境的问题,重装了flutter环境,但是问题依旧,在github上找到了解决此问题的方案。
报错原因:未知(从字面上根本无法判断,具体原因是cocoapods 版本原因,1.4版本的cocoapods才不报错)。
解决方案:
1,卸载cocoapods
$sudo gem uninstall cocoapods【Mac 10.10之前】
$sudo gem uninstall -n/usr/local/bin cocoapods【Mac 10.11之后】
2,重装cocoapods 1.4
$sudo gem install cocoapods -v 1.4
3,进入你项目中的ios目录设置pod
$cd 你项目根目录/ios
4,设置pod
$pod update
本站文章用于学习交流
新浪微博 | QQ群1:161644793qq | QQ群2:98711210
网站地图 | 网站统计
Copyright 2011 - 2021 paocode.com All Rights Reversed. 浙ICP备19041980号
瞎猫内容中心