Gow*_*n M 16 ios firebase swift google-cloud-firestore
我想配置Firebase Firestore.我按照所有步骤,但最后一步我得到了错误链接,我提到.
执行此pod后安装以下错误我得到了错误
[!] 因为没有指定平台
ios,所以11.4在目标上自动分配平台版本testing_gowtham.请在Podfile中为此目标指定一个平台.见https://guides.cocoapods.org/syntax/podfile.html#platform.
我的PodFile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'testing_gowtham' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for testing_gowtham
target 'testing_gowthamTests' do
inherit! :search_paths
# Pods for testing
end
target 'testing_gowthamUITests' do
inherit! :search_paths
# Pods for testing
end
pod 'Firebase/Core'
pod 'Firebase/Firestore'
end
Run Code Online (Sandbox Code Playgroud)
我看到了这个https://guides.cocoapods.org/syntax/podfile.html#platform,但我没有找到需要更改的行.
如何解决这个问题?
aBi*_*l17 30
用下面的文本替换整个pod文件,然后检查.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'testing_gowtham' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Firestore'
end
Run Code Online (Sandbox Code Playgroud)
(或)解决方案2
platform :ios, '9.0'工作......我只是删除#这
小智 14
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'testing_gowtham' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for testing_gowtham
pod 'Firebase/Core'
pod 'Firebase/Firestore'
end
Run Code Online (Sandbox Code Playgroud)
Tas*_*hin 14
在你的 Podfile -> 取消注释 platform 并设置 ios : 10.0
platform :ios, '10.0'
Run Code Online (Sandbox Code Playgroud)
这会起作用。
有三种方法可以修复它
由于这次 SDK 升级,iOS 10 现在是 FlutterFire 支持的最低版本。请更新您的构建目标版本。
解决方案:
转到ios/Podfile项目中的文件,然后取消注释?
# platform :ios, '9.0'
Run Code Online (Sandbox Code Playgroud)
然后把版本改成10?
platform :ios, '10.0'
Run Code Online (Sandbox Code Playgroud)
转到ios/Podfile 项目中的文件 ,在那里找到该行
# platform :ios, '9.0' // and uncomment it.
Run Code Online (Sandbox Code Playgroud)
取消注释您的 Podfile 后看起来像这样
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'testing_gowtham' do
# Comment the next line if you're not using Swift and don't want to use
dynamic frameworks
use_frameworks!
# Pods for testing_gowtham
pod 'Firebase/Core'
pod 'Firebase/Firestore'
end
Run Code Online (Sandbox Code Playgroud)
之后删除ios/Podfile.lock文件并运行pod install
在终端中按照以下命令解决问题:
gem uninstall cocoapods
gem install cocoapods
rm Podfile.lock
pod setup
pod install
Run Code Online (Sandbox Code Playgroud)
如果您rvm以 root 用户sudo身份安装,那么您必须安装任何东西。喜欢sudo gem uninstall cocoapods
更新了 2022 年的答案。 这是因为您的最低部署目标低于 iOS 10。根据Firebase ios 设置文档,您的项目必须面向 ios 平台版本 iOS 10 或更高版本:
命令$ flutter clean
打开目录中的Podfileios/Podfile
取消注释该行platform :ios, '9.0' and change 9.0 to 10.0
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
Run Code Online (Sandbox Code Playgroud)
保存文件
$ flutter run
小智 6
如果安装时出现上述错误pod 'PusherSwift', pod 'AlamofireImage'需要将#符号从
# platform :ios, '9.0'.
Run Code Online (Sandbox Code Playgroud)
然后在终端中写入命令pod install。
当您再次运行该项目时,错误将根据'pusher swift'.you have to click unblock option 出现。那么问题就顺利解决了。
删除Podfile.lock文件并运行pod install.
我通过更改目标 iOS 版本并在更多设备上开发应用程序来解决这个问题。
为我工作,但要小心 - 它将替换您正在使用的所有库的锁定(缓存)版本。检查自己是否完全理解Podfile.lock文件的作用 --> https://guides.cocoapods.org/using/using-cocoapods.html
对于Apple Silicon M1 芯片:
platform :ios, '11.4'或任何版本arch -x86_64 sudo gem install ffiflutter clean
cd ios
arch -x86_64 pod install
cd ..
flutter run
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14079 次 |
| 最近记录: |