ios - 我的代码错误#import
问题描述
我的问题是:我正在使用来自 pub.dev 的 [share package][1],当我尝试构建我的应用程序时,出现以下错误:
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~ ```
解决方案
修复错误:找不到“Flutter/Flutter.h”文件 #import <Flutter/Flutter.h> 您需要删除或不使用
firebase_admob
利用
native_admob_flutter
或者
admob_flutter
当你使用 firebase 并且你在 podfile 中使用这样的代码时,你会得到这个错误
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
推荐阅读
- ios - iOS 上的 Vuforia - 如何抓取相机帧
- sql-server - AWS DMS CDC SQL Server 源在调用 sys.fn_dump_dblog 时无法启动
- python - 将项目任务标签限定为项目标签
- c# - 具有 JWT 身份验证和多个提供程序的 .Net Core Web API
- mysql - 在 Galera 集群中读取插入的行(一个数据库连接,自动提交的查询)失败
- java - 如何在 javaFX 中从 ComobBox 中获取文本?
- typescript - “声明类型”和“类型”有什么区别
- jquery - 日期选择器不适用于动态元素 - Jquery
- php - 似乎无法从 PHP 和 MySQL 中转义字符
- python - Matplotlib 水平条形图向条形添加值