当前位置: 首页 > 知识库问答 >
问题:

Flutter致命错误:无法生成模块“firebase_core”-Flutter v2 iOS-firebase_core 1.2.0

松博耘
2023-03-14
 1 error generated.
/{my_user_path}/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-8.1.0/ios/Classes/FLTFirebaseSto
ragePlugin.m:6:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>

我以前没有得到这一点,我能够构建和部署OK。这是flutter和firebase的最新更新。

没有太多的“flutter clean”和删除podfile.lock工作。

Xcode输出:

Xcode's output:
/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/FirebaseDynamicLinks/FirebaseDynamicLinks/Sources/FIRDLJavaScriptExecut
or.m:158:12: warning: unused function 'processIsTranslated' [-Wunused-function]
static int processIsTranslated() {
           ^
1 warning generated.
/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/FirebaseDynamicLinks/FirebaseDynamicLinks/Sources/FIRDLJavaScriptExecut
or.m:158:12: warning: unused function 'processIsTranslated' [-Wunused-function]
static int processIsTranslated() {
           ^
1 warning generated.
/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm:41:29:
warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'NSInteger' (aka 'int')
[-Wshorten-64-to-32]
    _bytesLoaded = progress.bytes_loaded();
                 ~ ~~~~~~~~~^~~~~~~~~~~~~~
/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm:43:28:
warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'NSInteger' (aka 'int')
[-Wshorten-64-to-32]
    _totalBytes = progress.total_bytes();
                ~ ~~~~~~~~~^~~~~~~~~~~~~
/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm:97:17:
warning: implicit conversion loses integer precision: 'firebase::firestore::api::LoadBundleTask::LoadBundleHandle' (aka
'long long') to 'FIRLoadBundleObserverHandle' (aka 'int') [-Wshorten-64-to-32]
  return _task->Observe(std::move(core_observer));
  ~~~~~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
While building module 'firebase_core' imported from
/Users/abdelrahman/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-8.1.0/ios/Classes/FLTFirebaseSto
ragePlugin.m:6:
In file included from <module-includes>:1:
In file included from /Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/Target Support
Files/firebase_core/firebase_core-umbrella.h:13:
In file included from
/Users/abdelrahman/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.2.0/ios/Classes/FLTFirebaseCorePl
ugin.h:11:
/Users/abdelrahman/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.2.0/ios/Classes/FLTFirebasePlugin
.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin':
'/Users/abdelrahman/Desktop/bazaar_seller/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h'
[-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
        ^
1 error generated.
/Users/abdelrahman/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-8.1.0/ios/Classes/FLTFirebaseSto
ragePlugin.m:6:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>
 ~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Encountered error while building for device.

firebase_storage:8.1.0

firebase_messaging:10.0.0

共有1个答案

孙文康
2023-03-14

当我升级到flutter和Packages的最新版本时,我经历了一些类似的情况。

在某些情况下,除了“flutter clean”之外,解决方案是修复pub缓存。

dart pub cache repair

对我起作用的一个“顺序”也是:

>

  • 删除flutter.podspec(iOS/flutter/flutter.podspec)

    删除podfile.lock

  •  类似资料:
    • 刚刚创建了一个新的Flitter项目,添加了谷歌服务信息。将plist文件添加到iOS,并将firebase_core添加到pubspec。亚马尔。运行该项目并出现此错误<代码>错误:致命错误:在导入firebase_core时未找到模块“firebase_core” 我在stack overflow和gitlab上搜索了很多。尝试了所有的解决方法,比如颤振清理、更新repo、删除pod和重新安装

    • 在github和stack上搜索了很长时间的类似错误后,没有一个建议的解决方案帮助我解决了这个错误。 我试了好几样东西(有点乱): 删除IOS派生数据 更改firestore包版本 振作干净 RM-RF IOS/Pods rm-rf iOS/.symlinks rm-rf iOS/flutter/flutter.framework rm-rf iOS/flutter/flutter.podspec

    • 我无法为iOS构建颤动项目,给我的错误如下 尝试 吊舱拆卸 rm ios/颤抖/颤抖。podspec 颤振清洁 扑扑酒吧获取 吊舱安装 清除导出数据 颤振运行 仍然一样,我无法摆脱这个错误。我甚至尝试从pubsec.yaml中删除路径提供程序插件 任何帮助都将非常感谢,因为我已经坚持了24小时

    • 问题内容: 我正在尝试使用命令启动我的角度应用程序,但出现致命错误:生成cmd ENOENT。 我使用以下命令生成我的Angular App 然后我使用命令来启动我的应用 但它不起作用。 系统信息:操作系统:Windows 7 64 bit npm版本:2.11.3 请帮助我,我阅读了所有有关文档,但没有任何线索。 问题答案: 请尝试以下可能的解决方案: 验证npm文件夹是否存在于以下位置C:\

    • 问题内容: 我有一个函数(从文件顶部开始,这就是它的外观): 由于某种原因,我不断收到错误消息: 致命错误:无法在/Applications/MAMP/htdocs/question- air/includes/functions.php中重新声明generate_salt()(先前在/Applications/MAMP/htdocs/question- air/includes/function

    • 我在iOS中运行flutter应用程序时出错。 Xcode版本:13 模拟器 : iPhone 13 (版本 15.0) 错误: 我试过了: 删除 Podfile.lock 什么都没用