Please specify a platform for this target in your Podfile?

115,248

Solution 1

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

Solution 2

# 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

Solution 3

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

Solution 4

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

    platform :ios, '10.0'

this will work.

Solution 5

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.

Share:
115,248

Related videos on Youtube

Gowthaman M
Author by

Gowthaman M

honest Developer as well hardworker Android,IOS,Java,XML,Firebase,Firestore,HTML,Css,Java Script. Answering questions and helping others in Stack. Currently Working in TechMahindra in Bangalore

Updated on May 05, 2022

Comments

  • Gowthaman M
    Gowthaman M about 2 years

    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?

    • Sandeep
      Sandeep almost 6 years
      See the comment on the first line, it says uncomment second line in order to set the platform.
    • Gowthaman M
      Gowthaman M almost 6 years
      I removed second line still same error sir
    • Paul Beusterien
      Paul Beusterien almost 6 years
      Don't remove it, uncomment it
    • Gowthaman M
      Gowthaman M almost 6 years
      // # platform :ios, '9.0' i uncomment like this..but still same error sir
    • Paul Beusterien
      Paul Beusterien almost 6 years
      platform :ios, '9.0'
    • Jiya
      Jiya over 3 years
      Cange the " # platform :ios, '9.0' " To " platform :ios, '9.0' ". Just remove that "#"
  • Gowthaman M
    Gowthaman M almost 6 years
    thanks for your quick response...just I need to remove this line # platform :ios, '9.0' I am right
  • aBilal17
    aBilal17 almost 6 years
    No,, let me change my answer
  • Gowthaman M
    Gowthaman M almost 6 years
    Thanks bro.. I removed that line same error....can you please give exact answer what should I change..
  • Gowthaman M
    Gowthaman M almost 6 years
    Thank you I will check please just a min
  • Gowthaman M
    Gowthaman M almost 6 years
    aBilal17 what will the problem sir any another idea
  • aBilal17
    aBilal17 almost 6 years
    Bro i have removed another line from my answer. Can you please check it again? or send me your pod file on my email [email protected]
  • Gowthaman M
    Gowthaman M almost 6 years
    platform :ios, '9.0' is working bro...I have to remove # this
  • ssowri1
    ssowri1 over 5 years
    Thank you so much!
  • Dhaval Gevariya
    Dhaval Gevariya about 4 years
    Great kurupareshan .!! You saved my Time.
  • Vinny
    Vinny almost 3 years
    because it runs pod install again
  • Andre Pena
    Andre Pena about 2 years
    Afterwards, you have to go into the ios folder and run pod repo update but yes. This does indeed works. Thanks