73
votes

I want to config Firebase Firestore. I followed all the steps, but at the last step, I got the error link below I mention.

After Executing this pod install command below error I got

[!] Automatically assigning platform ios with version 11.4 on target testing_gowtham because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

My 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

I saw this https://guides.cocoapods.org/syntax/podfile.html#platform but I did not find which line I need to change .

How to solve this issue?

13
See the comment on the first line, it says uncomment second line in order to set the platform.Sandeep
I removed second line still same error sirGowthaman M
Don't remove it, uncomment itPaul Beusterien
// # platform :ios, '9.0' i uncomment like this..but still same error sirGowthaman M
platform :ios, '9.0'Paul Beusterien

13 Answers

99
votes

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

13
votes
# 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
7
votes

There are Three ways to fix it

  1. BREAKING FEAT: forward port to firebase-ios-sdk v7.3.0.
  • Due to this SDK upgrade, iOS 10 is now the minimum supported version by FlutterFire. Please update your build target version.

    Solution:

    Go to the file ios/Podfile inside your project, and uncomment


    # platform :ios, '9.0'
    

    Then change the version to 10


    platform :ios, '10.0'
    
  1. Go to the file ios/Podfile inside your project, find there the line

    # platform :ios, '9.0' // and uncomment it. 
    

    After uncommenting your Podfile will seems like 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
    

    After that delete ios/Podfile.lock file and run pod install

  2. Follow these commands in the terminal to fix the issue :

    gem uninstall cocoapods
    gem install cocoapods
    rm Podfile.lock
    pod setup
    pod install
    

If you have installed rvm as the root user, then you must sudo to install anything. like sudo gem uninstall cocoapods

6
votes

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.

4
votes

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

3
votes

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

    platform :ios, '10.0'

this will work.

1
votes

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
0
votes

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

0
votes

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!

0
votes

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.

0
votes

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.

0
votes

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

-1
votes

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.