Swift Pod还不能集成为静态图书馆Firebasecoreintern-library
我正在flutter flutter构建一个应用程序。我在执行“ pod install
”或“ pod install-repo-update
”或“ pod update
”和pod时,我收到了此错误消息。安装失败并停止。
错误消息:
[!]以下迅速豆荚还不能集成为静态 库:
Swift Pod
firebasecoreintern-library-library
取决于Google-utilities-library
,该不定义模块。选择 这些目标生成模块地图(这是导入的必要条件 它们是从Swift构建为静态库时),您可以设置use_modular_headers!
在您的podfile中或指定:modular_headers => true
针对特定依赖关系。
我的podfile:
platform :ios, '11.0'
...
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(27)
您可能不需要使用
use_frameworks!
或use_modular_headers!
,因为它与use_flipper发生冲突,您可以在iOS/podfile中添加以下内容,而无需在iOS/podfile中使用它们
:
You may not need to use
use_frameworks!
oruse_modular_headers!
because it's getting conflict with use_flipperYou can add the following without using them in ios/Podfile:
Best
对于
firebase的最新版本15.1.1
带有react-native 0.69.1
无需启用use_frameworks
,因为它会导致部署中的错误实际设备,因此您只需要添加
firebase
模块化,然后将标题设置为true。并继续使用Flipper,
我在真实设备上都在Android和iOS上测试了它,并且效果很好!
For newest version of
firebase 15.1.1
withreact-native 0.69.1
no need to enableuse_frameworks
because it will lead to errors in deploying in real devicesSo you just need to add the
firebase
modulars and set headers to true.And keep using flipper
I tested it on both Android and IOS on real devices and it works great! ????
Here is what my Podfile looks like
-
UPDATED 20/Jul
If you wanted to use rich content notifications like notifications with images. Following this article by firebase will ask you to enable
use_frameworks
as well so my solution for that is to usemodular_headers => true
for the following packagesNOTE: Make sure
richNotification
target is at the bottom of thepodfile
. see below how my finalpodfile
looks likeI tested it on both Android and IOS, it works great!! ????
For Testing
Send the following JSON data to
https://fcm.googleapis.com/fcm/send
as a"POST", and make sure to put in the headers"mutable-content": "1",
See the screenshot belowHeaders look like

pod“ google utilities”,:modular_headers =>真的;
将此行添加到podfile
pod 'GoogleUtilities', :modular_headers => true;
add this line to podfile
这也对我有用。 @virluz刚刚添加到您的答案
版本的firebase 16.5,with react-native 70.5
添加
只是在以下代码之间
:之后您可以运行
This worked for me too. @virluz just adding to your answer
Version of firebase 16.5 with react-native 70.5
Just add
Between below code :
After that you can run
删除
use_frameworks
,因为与use_flipper
相冲突并添加所有这些libs for me>和
firebasestorage-h.swift
需要use_frameworks
,因此您可能对这些文件有错误。也许您可能更喜欢使用Axios
或类似的lib来调用您的端点API和/或aws s3
来保存文件。Removing
use_frameworks
because is conflicting withuse_flipper
and adding all this libs worked for meHeads up!
FirebaseFunctions-h.swift
andFirebaseStorage-h.swift
requiresuse_frameworks
, so probably you may have an error with these files. Perhaps you may prefer useaxios
or similar lib to invoke your endpoint api and/oraws s3
to save your file instead.❗️ArectNative Developers:
我询问了
React-Native-Firebase
的维护者,关于这里找到的解决方案,他们说该应用程序最终会随着这些解决方法而破裂,因为模块转换为迅速。firebaseFunctions-h.swift
和firebasestorage-h.swift
已经无法正常工作。这是粘贴答案的副本:原始答案:
“ 这也是React本土社区的正式讨论: https://github.com/reaeact-native-community/discussions-and-proposals/discussions/546#discussioncomment-4168642
❗️ React Native developers:
I asked the maintainers of
react-native-firebase
about the solutions found here and they said the app will eventually break with these workarounds as modules are converted to Swift.FirebaseFunctions-h.swift
andFirebaseStorage-h.swift
already won't work. Here's the copy pasted answer:Original answer: https://github.com/invertase/react-native-firebase/issues/6594#issuecomment-1303612795
EDIT: Here's also an official discussion from the React Native community: https://github.com/react-native-community/discussions-and-proposals/discussions/546#discussioncomment-4168642
但是
app.config.js
add:<<<<<关键步骤cd ios&& POD安装
EAS构建-Platform iOS- profile Development- -local
rnfirebase版本
None of the previously suggested solutions worked for me (I also use Expo), however, adding the following snippet to
app.config.js
solved it for me:npx expo install expo-build-properties
app.config.js
add: <<<< CRITICAL STEP Referenced herecd ios && pod install
eas build --platform ios --profile development --local
RNFirebase versions
关于博览会管理,这是我制作的配置插件,并为我工作
Regarding Expo managed, here's a config plugin that I've made, and works for me
最后,经过很多问题,答案是对用户flipper和modular_header的答案,最后我的Pod文件看起来像这样: -
Finally after going through so many questions the answer was to user Flipper and modular_header in same time, finally my Pod file looks like this :-
我只添加了这2行
Podfile(ios)
I added only these 2 lines
Podfile (IOS)
当我尝试将Firebase存储库中的React Native CLI项目实施时,我遇到了同样的问题。我将以下代码添加到podfile
中下面代码之后的podfile
I faced the same issue when I tried implementing the Firebase storage library into my React Native CLI project. I added the following code to the Podfile
Put above code right after the code below in the PodFile
添加到POD文件中
在
target
之前,将其Add this in the Pod file before the
target
This work well for React Native Application
添加在豆荚文件的目标部分内:
并禁用flipper
Add inside your target section of Pods file:
And disable flipper
如果您正在使用Apple Silicon M机器使用React Native版本0.73.2,并且正在尝试安装React Firebase App版本18.8.0或更高版本,则在打算保持
use_flipper
Active时,您可能会遇到一些问题。最初,您可能会认为在podfile中包含以下几行,以解决潜在的兼容性或链接问题的库:但是,此设置可能无法解决问题,尤其是在构建过程中遇到“未找到-lfirebase”错误的“未找到-lfirebase”错误的情况下。
我在Firebase Pod或Xcframeworks的构建路径中没有发现任何firebase静态lib。
以我的经验,仅包括以下豆荚来简化podfile可以解决问题:
此问题的根本原因可能与Firebase Pod从使用静态库向XCFrameworks的过渡有关。
If you're working on an Apple Silicon M machine with React Native version 0.73.2 and are trying to install React Native Firebase App version 18.8.0 or above while intending to keep
use_flipper
active, you might encounter some issues. Initially, you might think to include the following lines in your Podfile to address potential compatibility or library linking problems:However, this setup might not resolve the issue, particularly if you encounter a "library not found for -lFirebase" error during the build process.
I didn't find any Firebase static lib in the build path for the Firebase pod, or xcFrameworks either.
In my experience, simplifying the Podfile by only including the following pods can solve the problem:
The underlying cause of this issue might be related to the transition of the Firebase pod from using static libraries to XCFrameworks.
对于 React Native Expo :在SDK50
和App.json上进行测试,更新
expo.plugins
asFor REACT NATIVE EXPO: Tested on SDK50
and in app.json, update
expo.plugins
as添加到Podfile并更新POD
Add to Podfile and update pod
我面对的firebase版本(^18.7.3)。在您的情况下,它可以是其他的。
我在全球上添加了这条代码行,正是错误的:
在Podfile顶部的这两条线下方
,POD安装对我来说是成功的。错误在下面
。 alt =“错误是这样的样子的某些情况”>
The similer issue I faced with firebase version (^18.7.3). it can be any other in your case.
I added this line of code globally as it is mentioned in error:
below these two lines at the top of podfile
and the pod installation succeed for me. The error is below
.
对我来说,问题仅仅是因为Podfile的版本与新版本的Firebase模块不兼容。
我正在研究 React Native ,因此生成的Podfile版本不是最新的。因此,我的火箱模块在podfile中需要其他东西。
这是一个易于修复的修复程序,可以添加podfile :
但是,您还可以关注包装的历史。
我对6月发布的本地0.69做出了反应。当时我刚刚检查了Firebase打包版本,并且已经安装了这些版本。
这也有效。
For me the issue was simply because the version of the Podfile was not compatible with the new version of Firebase modules.
I am working on React Native, so the version of Podfile generated was not the latest one. Due to this my Firebase modules required something else in the Podfile.
It was an easy fix to add in the Podfile:
However, you can also keep an eye on the history of your packages.
I had React Native 0.69 that was released in June. I just checked the Firebase packaged version at that time and I have installed those ones.
This works as well.
对于本机应用程序项目,这是 firebase apple sdk apple sdk sdk版本(版本9.0。 0):
只需在您的Podfile中添加任何一行即可。文档中解释了差异: link firebase依赖性在统计上或动态上均为。
For native app projects, here's the Firebase Apple SDK Release Notes (Version 9.0.0):
Just add either line in your Podfile. The difference is explained in the document: Link Firebase dependencies statically or dynamically.
将其放在Podfile&amp;运行POD安装
Solved after put this to Podfile & run pod install
对于在2024年面临同一问题的任何人,我建议您只使用博览会构建;特别是如果您仍在研究该项目,并且可能以后添加其他软件包。
两个步骤:
“插件”:[
“博览会”,
“博览会”,
[
“博览会 - 企业”,
{
“ ios”:{
“ useframeworks”:“静态”,
“ podfileproperties”:{
“ use_modular_headers!”:true
}
}
}
这是给出的
]
您可以运行NPX Expo Prebuild -CLEAN或NPX EXPO PREBUILD
For anyone facing this same issue in 2024, I Will recommend you just use expo-build-properties; especially if you are still working on the project and might add other packages later.
Two steps:
"plugins": [
"expo-font",
"expo-router",
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static",
"podfileProperties": {
"use_modular_headers!": true
}
}
}
]
]
And you can run npx expo prebuild --clean or npx expo prebuild
只要使用最新的软件包,您可能会急切地试图解决此问题,您可能最终会处理“仅在iOS 15中支持并发”。那看起来是一个死胡同。降级包装并等待React Native +70.0可能符合您的最大利益。
Just a heads up for those desperately trying to fix this, using the newest packages, you may end up dealing with the warning "concurrency is only supported in IOS 15". That looks to be a dead end. It may be in your best interest to downgrade the package and wait for react native +70.0.
我关注 kvba 的config插件。
我正在强迫FirebasesDkversion到10.1.0:
I followed kvba 's config plugin.
I'm forcing the FirebaseSDKVersion to 10.1.0:
当我在使用Firebase Analytics时尝试使用Google Tag Manager时,我遇到了同样的问题。
对我有用的解决方案是在
>“ googletagmanager”
中添加target'runner'do
不在外面。像这样:
I faced the same issue when i try to use Google Tag Manager while I was using Firebase Analytics.
the solution that worked for me is to add the
pod 'GoogleTagManager'
inside thetarget 'Runner' do
NOT out side it.like this:
我使用文档中知道的步骤解决了这个问题。在步骤中:更改
cocoapods
首先使用框架,添加
podfile
运行命令:
我的项目使用:使用:
I resolved this problem using the steps informed in docs https://rnfirebase.io/. in step: Altering
CocoaPods
to use frameworksfirst, add in
Podfile
after running the commands:
My project using:
您应该切换到使用React Native Firebase,因为Expo-Firebase-Analytics目前在Android和iOS上都面临许多问题。即使您设法解决了iOS上的所有错误,Expo-Firebase-Analytics仍然无法在Gradle 8(Android)上运行。
这是迁移从博览会 - 循环分析的指南,以反应本地燃料。我已经应用和测试了它,现在一切都可以在两个平台上完美运行。
从Expo Firebase(Expo-Firebase-Analytics)迁移以反应本地燃料
然后阅读此文档,以获取有关本机firebase的更多详细信息:
https://rnfirebase.io/#expo
[firebase]自动收集的事件
you should switch to using React Native Firebase because expo-firebase-analytics is currently facing numerous issues on both Android and iOS. Even if you manage to resolve all the errors on iOS, expo-firebase-analytics still cannot run on Gradle 8 (Android).
Here is a guide to migrating from expo-firebase-analytics to React Native Firebase. I have applied and tested it, and everything is now working perfectly on both platforms.
Migrating from Expo Firebase (expo-firebase-analytics) to React Native Firebase
https://github.com/expo/fyi/blob/main/firebase-migration-guide.md
Then read this document for more details about React Native Firebase:
https://rnfirebase.io/#expo
[Firebase] Automatically collected events
https://support.google.com/analytics/answer/9234069?hl=en&ref_topic=13367566&sjid=3847978116116908888-AP