ios 请在您的 Podfile 中为此目标指定平台?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52040910/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:46:55  来源:igfitidea点击:

Please specify a platform for this target in your Podfile?

iosswiftfirebasegoogle-cloud-firestore

提问by Gowthaman M

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

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

After Executing this pod installCommends below error I got

执行此pod install 后出现以下错误提示

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

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

My PodFile:

我的 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#platformbut I did not find which line I need to change .

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

How to solve this issue?

如何解决这个问题?

回答by aBilal17

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

用下面的文本替换整个 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

(or) solution 2

(或)解决方案2

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

platform :ios, '9.0'正在工作......我只是删除了#这个

回答by kurupareshan

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

如果安装时出现上述错误pod 'PusherSwift'pod 'AlamofireImage'需要将#符号从

# platform :ios, '9.0'.

Then write the command pod installin your terminal.

然后在终端中写入命令pod install

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.

当您再次运行该项目时,错误将根据'pusher swift'.you have to click unblock option 出现。那么问题就顺利解决了。

回答by Onyekachi Samuel

# 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

回答by Hourglasser

Delete Podfile.lockfile and run pod install.

删除Podfile.lock文件并运行pod install

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

我通过更改目标 iOS 版本并在更多设备上开发应用程序来解决此问题。

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.lockfile does here --> https://guides.cocoapods.org/using/using-cocoapods.html

为我工作,但要小心 - 它会替换您正在使用的所有锁定(缓存)版本的库。检查自己是否完全理解Podfile.lock这里文件的作用 --> https://guides.cocoapods.org/using/using-cocoapods.html