【发布时间】:2021-05-14 19:49:43
【问题描述】:
我一直在尝试在 IOS 设备上运行我的 Flutter 代码。但是,我在框架模块中遇到了一些关于非模块化标头的错误。
日志:
While building module 'firebase_core' imported from
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_auth-0.20.0+1/ios/Classes/FLTFirebaseAuthPlugin.m:5:
In file included from <module-includes>:1:
In file included from
/Users/admin/Desktop/Ali/GuestInMe/ios/Pods/Target Support
Files/firebase_core/firebase_core-umbrella.h:13:
In file included from
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_core-0.7.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_core-0.7.0/ios/Classes/FLTFirebasePlugin.h:9:9: error:
include of non-modular header inside framework module
'firebase_core.FLTFirebasePlugin':
'/Users/admin/Desktop/Ali/GuestInMe/ios/Pods/Headers/Public/Firebase
Core/FirebaseCore.h'
[-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_auth-0.20.0+1/ios/Classes/FLTFirebaseAuthPlugin.m:5: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
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
我尝试过的:
【问题讨论】:
-
我刚刚遇到了与 Facebook ShareKit SDK (github.com/facebook/facebook-ios-sdk/issues/1649) 几乎相同的问题我希望我能给出一个解决方案,但我最终创建了一个新的颤振项目(使用 Swift iOS 项目)并重新- 用 Swift 编写我所有的本机代码。我不知道解决方案是 Swift vs Objective C,还是新的 Flutter 项目 vs 旧的(我的项目是 2 年)我建议创建一个新的 Flutter 项目,包括那些依赖项,然后构建。如果您遇到同样的问题,请向 Flutter 团队提出问题。如果不是,那是某个地方的配置问题:-(
-
创建一个新的颤振项目也为我解决了这个问题。我只是将新创建的 ios 文件夹替换到我的旧项目中。
标签: firebase flutter flutter-dependencies flutter-ios