我正在开发一个使用本地数据库的Flutter项目。对于本地数据库,我正在使用sqflite
插件https://pub.dartlang.org/packages/sqflite。我的应用程序运行正常,无需安装sqflite。但是,一旦我安装sqflite
。它停止为ios运行。我收到以下错误消息。
导入 产生1个错误。 ===具有配置调试功能的项目运行器的构建目标运行器=== 在/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/AppDelegate.m中包含的文件中:1: / Users /用户/文档/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/AppDelegate.h:2:9:致命错误:未找到“ Flutter / Flutter.h”文件 进口 ^ ~~~~~~~~~~~~~~~~~~ 产生1个错误。 / Users /用户/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/main.m:2:9:致命错误:找不到“ Flutter / Flutter.h”文件 进口 ^ ~~~~~~~~~~~~~~~~~~ 产生1个错误。 ===具有配置调试功能的项目运行器的构建目标运行器=== ld:找不到文件:/Users/user/Library/Developer/Xcode/DerivedData/Runner-ctqhqjwcexxoquevqxydctppmagio/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate.o clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) 无法为模拟器构建应用程序。 在iPhone 8 Plus上启动应用程序时出错。
。而奇怪的是,在发生此错误之后,如果我创建了一个新的flutter项目,它将给我以下错误。
/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/AppDelegate.h:1:9:致命错误:找不到'Flutter / Flutter.h'文件导入^ ~~~~~ ~~~~~~~~~~~~~~产生1个错误。 ===具有配置调试功能的项目运行器的目标创建器=== /Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/main.m:1:9:致命错误:'Flutter / Flutter。找不到h'文件#import ^ ~~~~~~~~~~~~~~~~~ 1错误生成。 ===具有配置调试功能的项目运行器的目标创建器===在/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/GeneratedPluginRegistrant.m:5中包含的文件:/ Users / user / Documents /DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/GeneratedPluginRegistrant.h:8:9:致命错误:找不到'Flutter / Flutter.h'文件#import ^ ~~~~~~~~~~~~~ ~~~~~产生1个错误。 ===带有配置调试程序的项目目标运行程序的内置目标运行程序=== ld:找不到文件:/Users/user/Library/Developer/Xcode/DerivedData/Runner-eqhuhphzvosrgvdilnpudqzvakju/Build/Intermediates.noindex/Runner.build/Debug- iphonesimulator / Runner.build / Objects-normal / x86_64 / AppDelegate.o铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)无法为模拟器构建应用程序。在iPhone 8 Plus上启动应用程序时出错。
该应用程序停止工作。这是flutter doctor
命令的输出。
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.8.7-pre.6, on Mac OS X 10.14 18A384a, locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.27.2)
[✓] Connected devices (1 available)
请帮助我。预先感谢。
答案 0 :(得分:0)
尝试将Flutter频道从Master更改为Beta
在终端中打开flutter目录并设置导出路径的类型
flutter channel beta