问题描述
我刚刚下载了Xcode 12 beta6。我已经在该项目中安装了Firebase,但出现此错误。当我用建议纠正它时,它告诉我用原件再次纠正。所有“ GoogleDataTransport”都会重复出现此错误。您可以将Firebase与Xcode 12 beta 6一起使用吗?我究竟做错了什么?谢谢
解决方法
更新到CocoaPods 1.10,运行import Document,{ Html,Head,Main,NextScript } from 'next/document';
class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head /> // do this
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;
和pod deintegrate
。
要在早期的CocoaPods版本中变通,请在generate Pods项目的“构建设置”中禁用pod install
选项:
https://github.com/firebase/firebase-ios-sdk/issues/5987和https://github.com/CocoaPods/CocoaPods/issues/9902中的更多详细信息。
,我通过使用可可脂的预发布版本进行了修复
sudo gem install cocoapods --pre
然后进行更新
pod install --repo-update
我的团队不想在发布cocoapods 1.10之前使用它,也不想每次pod install
重新生成Pods项目的构建设置时都使用它。 Podfile post_install step做到了这一点,并记入Léo-Paul JULIE:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
end
编辑:正如下面的snakeoil所指出的,您也可以使有关您不支持的不相关的iOS版本的恼人警告消失。但是,应该为每个 target 的 configuration 的构建设置编辑该设置,因此应嵌套嵌套。总而言之,我现在正在处理这样的事情:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
# Can be removed when moving to cocoapods 1.10
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Inherit the deployment target defined in this Podfile instead,e.g. platform :ios,'11.0' at the top of this file
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
,
首先,检查命令行工具并安装。
sudo xcode-select --switch /Applications/Xcode-beta.app
sudo xcode-select --install
安装cocoapods的Beta版
sudo gem install cocoapods --pre
切换到您的xCode项目。
pod deintegrate
pod install --repo-update
,
就我而言,Performance Monitoring Pod 导致了这个问题。当我尝试安装性能监控时。
pod 'Firebase/Performance'
不知何故,它与 Firebase Core Pod 发生了冲突。解决它。
- 注释掉 Podfile 中的所有 Firebase Pod
- 运行 Pod 安装
- 在 Podfile 中取消注释 Firebase 性能监视器
- 运行 Pod 安装
- 在 Podfile 中取消注释所有其他 Firebase Pod
- 运行 Pod 安装