请在您的 Podfile 中为这个目标指定一个平台?

我想要配置 Firebase Firestore。我遵循了所有的步骤,但是在最后一步,我得到了下面提到的错误链接。

执行这个 吊舱安装命令后,我得到了以下错误

[ ! ]自动分配版本为 11.4的平台 ios 目标 testing_gowtham,因为没有指定平台。请 在您的 Podfile 中为这个目标指定一个平台 https://guides.cocoapods.org/syntax/podfile.html#platform.

我的个人档案:

# 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

我看到这个 https://guides.cocoapods.org/syntax/podfile.html#platform,但我没有找到我需要改变哪一行。

如何解决这个问题?

141069 次浏览

Replace your whole pod file text with below text and then check.

# 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

(or) solution 2

platform :ios, '9.0' is working...I simply removed # this

# 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

If the above error occurs when you install pod 'PusherSwift' and pod 'AlamofireImage' you have to remove # symbol from

# platform :ios, '9.0'.

Then write the command pod install in your terminal.

When you run the project again the error will appear according to 'pusher swift'.you have to click unblock option. Then the problem is successfully solved.

Delete Podfile.lock file and run pod install.

I got this issue by changing the target iOS version and developing application on more devices.

Worked for me, but be careful - it will replace all, let's say, locked (cached) versions of libraries, that you are using. Check yourself that you fully understand what Podfile.lock file does here --> https://guides.cocoapods.org/using/using-cocoapods.html

platform :ios, '9.0' is working...I simply removed # this

In Flutter project, I Also faced with this issue. Fixed by updating flutter and cocoa pods to the latest version.

Solution:-

  • flutter clean
  • rm -Rf ios/Pods
  • rm -Rf ios/.symlinks
  • rm -Rf ios/Flutter/Flutter.framework
  • rm -Rf ios/Flutter/Flutter.podspec
  • cd ios
  • pod install
  • cd ..
  • flutter build ios

In my case it was because of an old project which I didn't run for like 6 months.

I just created a new Flutter project using this command flutter create -i swift -a kotlin project_name

And moved the ios folder to my project, run it and it works!

You have to remove # symbol from

  • cd ios
  • open podfile

and remove # symbol and save this file

#platform :ios, '9.0'.

Then write the command pod install in your terminal.

In your Podfile -> Uncomment platform and set ios : 10.0

    platform :ios, '10.0'

this will work.

I have got this error many times while running flutter firebase project. Simple solution is: Replace:

# platform :ios, '9.0' with platform :ios, '9.0'

Actually # make it commented so we are just uncommenting it.

To solve this : open your pod file in Andriod Studio --> ios--> Podfile then you will see at the top of the file a commented out example:

platform :ios, '9.0'

uncomment this line and re-run the app to see if it works. If it's still not working then change the version to match your minimum requirement. I've set mine to iOS 12 as one of my dependencies required this.

The simplest answer is uncomment second line of Podfile and change the iOS version to 10 like this. Note that the very next following Xcode build will take a bit more time than usual. I don't know why...

platform :ios, '10.0'

enter image description here

You shouldn't remove everything inside Podfile, just Uncomment this line:

platform :ios, '9.0'

from ios/Podfile

Updated answer for 2022. This is due to your minimum deployment target being less than iOS 10. According to the Firebase ios setup documentation, your project must target ios platform versions iOS 10 or later:

  1. command $ futter clean

  2. Open the Podfile at the directory ios/Podfile

  3. uncomment the line 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'
    
  4. save the file

  5. $ flutter run

For Apple Silicon M1 chips:

  1. Edit ./ios/Podfile platform :ios, '11.4' or whatever version
  2. Install ffi arch -x86_64 sudo gem install ffi
  3. Reinstall pods
flutter clean
cd ios
arch -x86_64 pod install
cd ..
flutter run

pod update and pod install again

cd iOS run the following -

pod deintegrate --verbose
sudo gem pristine ffi --version 1.14.2

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

In side the Podfile

Specifying the platform version on your plaform

Remove the # platform :ios, '9.0'

# platform :ios, '9.0' ( comment note)

Write it like these

platform :ios, '13.0'