[英]@react-native-firebase pod version conflict for Firebase/CoreOnly
I have a react-native project with these dependencies (all are the latest available):我有一个带有这些依赖项的 react-native 项目(都是最新的):
"@react-native-firebase/analytics": "^14.5.1",
"@react-native-firebase/app": "^14.5.1",
"@react-native-firebase/config": "^0.1.5",
"@react-native-firebase/perf": "^14.5.1",
But when I go to pod install
, I get:但是当我 go 到pod install
时,我得到:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In Podfile:
RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 14.5.1, which depends on
Firebase/CoreOnly (= 8.12.1)
RNFBConfig (from `../node_modules/@react-native-firebase/config`) was resolved to 0.1.5, which depends on
Firebase/RemoteConfig (~> 6.5.0) was resolved to 6.5.0, which depends on
Firebase/CoreOnly (= 6.5.0)
I do not understand why config has a different version to all the others and how the latest versions of a project are conflicting.我不明白为什么 config 的版本与所有其他版本不同,以及项目的最新版本如何冲突。
I have tried the following to fix this: rm -rf ios/Pods ios/Podfile.lock
pod repo remove trunk
pod install
pod update
pod install --repo-update
我尝试了以下方法来解决这个问题: rm -rf ios/Pods ios/Podfile.lock
pod repo remove trunk
pod install
pod update
pod install --repo-update
My ios/Podfile does not contain explicit pods for Firebase.我的 ios/Podfile 不包含 Firebase 的显式 pod。
Usually these commands tend to fix problems like this.通常这些命令倾向于解决这样的问题。 But not this time.但这次不是。 Thanks for any suggestions.感谢您的任何建议。
react-native-firebase maintainer here! react-native-firebase 维护者在这里!
The 'config' package was wrapping the firebase "Remote Config" SDK packages, so that name was not used in the final release of react-native-firebase - we used "remote-config" in the end, but the alpha releases with the wrong name were still up on npmjs.com. “配置”包包装了 firebase“远程配置”SDK 包,因此在 react-native-firebase 的最终版本中没有使用这个名称——我们最后使用了“remote-config”,但 alpha 版本与npmjs.com 上仍然显示错误的名称。
I just deprecated all versions of that package on npmjs.com so users should get a warning if they try to install it - no one should use that package.我只是在 npmjs.com 上弃用了该软件包的所有版本,因此如果用户尝试安装它,他们应该会收到警告——没有人应该使用该软件包。 If you use the 'remote-config' one, you'll be all set I think如果你使用'remote-config',我想你已经准备好了
The problem is that @react-native-firebase/config
appears unrelated to the @react-native-firebase
project, hence the different latest version and pod conflicts.问题是@react-native-firebase/config
似乎与@react-native-firebase
项目无关,因此不同的最新版本和 pod 冲突。 I had to use @react-native-firebase/remote-config
instead, as found in the documentation https://github.com/invertase/react-native-firebase正如文档https://github.com/invertase/react-native-firebase中所见,我不得不改用@react-native-firebase/remote-config
The problem is that react native update a new architecture问题是 react native 更新了一个新的架构
use_frameworks: :linkage => :static
inside your targets打开文件Podfile并在目标中添加use_frameworks: :linkage => :static
:flipper_configuration
line禁用:flipper_configuration
行$RNFirebaseAsStaticFramework = true
at the top of podfile将$RNFirebaseAsStaticFramework = true
放在 podfile 的顶部Then run然后运行
pod install --repo-update
For Mac M1对于 Mac M1
arch -x86_64 pod install --repo-update
Hope this useful to someone希望这对某人有用
I solved the issue by deleting the ./ios/Podfile.lock
and run again pod install --repo-update
command.我通过删除./ios/Podfile.lock
并再次运行pod install --repo-update
命令解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.