有没有办法解决我在 flutter 中升级 firebase 后面临的问题
Is there a way to solve the problem I am facing after upgrading firebase in flutter
嗨,我在 运行 我的应用程序仅在 iOS 模拟器中遇到了 flutter 错误。它在 Android 模拟器中工作得很好。在我升级了我从那时起添加的 firebase 依赖项之后,我遇到了这个问题。
我之前用的版本如下
firebase_auth: ^0.18.3
cloud_firestore: ^0.14.3
firebase_core: ^0.5.2
firebase_crashlytics: ^0.2.4
我现在使用的版本如下
firebase_auth: ^0.20.0
cloud_firestore: ^0.16.0
firebase_core: ^0.7.0
firebase_crashlytics: ^0.4.0
我得到的错误是
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please
specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 12.
请注意,此问题仅出现在 iOS 中,而不出现在 Android 中,我想升级 firebase。
我在 Whosebug 和其他资源上尝试了很多方法,但似乎没有帮助。
删除ios文件夹中的2个pod文件。 运行 在终端中使用 Flutter clean 命令,然后尝试 运行 在您的 iPhone 上安装该应用程序。
这种情况经常发生在我身上,上面的方法对我很有效。
出现此问题是因为您没有在 Podfile 中设置最低 ios 版本。
在 Podfile 中设置平台版本。
cd ios
nano Podfile
取消注释文件开头的这一行
# platform :ios, '9.0'
如果您愿意,可以将版本设置为 11.0,因为某些插件不再支持 9.0。
完成后,运行以下命令:
rm Podfile.lock
rm -rf Pods
pod install
此外,您可以将 Runner 中应用程序的最低 iOS 版本更新为您在 Podfile
中设置的版本
这应该适合你。
我试过很多东西但都失败了
现在我为 MacBook M1 芯片用户提供了完美的解决方案。
我们需要清除所有缓存文件并更新 pods
最好按照以下步骤操作
去掉flutter里面iOS文件夹里的.Pods和.symlinks
项目。
删除Podfile.lock删除pubspec.lock
运行 扑干净
运行 Flutter 酒吧获取
切换到iOS文件夹和运行
sudo arch -x86_64 gem install ffi
arch -x86_64 pod update
PS:M1用户
嗨,我在 运行 我的应用程序仅在 iOS 模拟器中遇到了 flutter 错误。它在 Android 模拟器中工作得很好。在我升级了我从那时起添加的 firebase 依赖项之后,我遇到了这个问题。 我之前用的版本如下
firebase_auth: ^0.18.3
cloud_firestore: ^0.14.3
firebase_core: ^0.5.2
firebase_crashlytics: ^0.2.4
我现在使用的版本如下
firebase_auth: ^0.20.0
cloud_firestore: ^0.16.0
firebase_core: ^0.7.0
firebase_crashlytics: ^0.4.0
我得到的错误是
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please
specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 12.
请注意,此问题仅出现在 iOS 中,而不出现在 Android 中,我想升级 firebase。 我在 Whosebug 和其他资源上尝试了很多方法,但似乎没有帮助。
删除ios文件夹中的2个pod文件。 运行 在终端中使用 Flutter clean 命令,然后尝试 运行 在您的 iPhone 上安装该应用程序。 这种情况经常发生在我身上,上面的方法对我很有效。
出现此问题是因为您没有在 Podfile 中设置最低 ios 版本。
在 Podfile 中设置平台版本。
cd ios
nano Podfile
取消注释文件开头的这一行
# platform :ios, '9.0'
如果您愿意,可以将版本设置为 11.0,因为某些插件不再支持 9.0。
完成后,运行以下命令:
rm Podfile.lock
rm -rf Pods
pod install
此外,您可以将 Runner 中应用程序的最低 iOS 版本更新为您在 Podfile
中设置的版本
这应该适合你。
我试过很多东西但都失败了 现在我为 MacBook M1 芯片用户提供了完美的解决方案。 我们需要清除所有缓存文件并更新 pods
最好按照以下步骤操作
去掉flutter里面iOS文件夹里的.Pods和.symlinks 项目。
删除Podfile.lock删除pubspec.lock
运行 扑干净
运行 Flutter 酒吧获取
切换到iOS文件夹和运行
sudo arch -x86_64 gem install ffi arch -x86_64 pod update
PS:M1用户