无法使用cocoaPods下载库

时间:2017-07-06 09:21:20

标签: swift cocoapods

我是swift编程的新手。我正在尝试下载项目的库。我已经安装了可可豆荚:sudo gem install cocoa pods,创建了包含我需要的所有库的pod文件:pod' GoogleMaps'。安装pod后我收到错误:

 Unable to satisfy the following requirements:

 - `GoogleMaps` required by `Podfile`
 - `GoogleMaps` required by `Podfile`
 - `GoogleMaps (= 2.3.1)` required by `Podfile.lock`

 Specs satisfying the `GoogleMaps, GoogleMaps (= 2.3.1)` dependency    
 were found, but they required a higher minimum deployment target.

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

我的pod文件:

  # Uncomment the next line to define a global platform for your    
  project
  # platform :ios, '9.0'

  target 'Taxi for rider' do
  # Comment the next line if you're not using Swift and don't want to     
  use dynamic frameworks
  use_frameworks!

  # Pods for Taxi for rider
  pod 'Firebase'
  pod 'Firebase/Storage'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'GoogleMaps'
  pod 'GoogleMaps'
  pod 'GooglePlaces'
  pod 'GooglePlacesAPI'
  pod 'GooglePlacePicker'
  pod 'SwiftyJSON'
  pod 'Firebase/Core'
  pod 'Firebase/Storage'

  end

3 个答案:

答案 0 :(得分:1)

用以下文字替换您的podfile文本:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Taxi for rider' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!


 # Pods for Taxi for rider

  pod 'Firebase'
  pod 'Firebase/Storage'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'GoogleMaps'
  pod 'GoogleMaps'
  pod 'GooglePlaces'
  pod 'GooglePlacesAPI'
  pod 'GooglePlacePicker'
  pod 'SwiftyJSON'
  pod 'Firebase/Core'
  pod 'Firebase/Storage'
end

以下是代码中的错误行:

# Uncomment the next line to define a global platform for your    
project

应该是:

# Uncomment the next line to define a global platform for your project

您已多次添加pod 'GoogleMaps'

答案 1 :(得分:0)

您应该在Podfile中为项目定义一个平台。将其附加到Podfile的开头:

public void onOpenDocument(PdfWriter writer, Document document) {
    total = writer.getDirectContent().createTemplate(30, 16);
    try {
        totalPages = Image.getInstance(total);
    } catch (BadElementException e) {
        e.printStackTrace();
    }
    totalPages.setRole(PdfName.ARTIFACT);
}
public void onEndPage(PdfWriter writer, Document document) {

    footer.writeSelectedRows(0, -100, 36, 65, writer.getDirectContent());
    try {
        PdfPCell cell = new PdfPCell(Image.getInstance(total));
    } catch (BadElementException e) {
        e.printStackTrace();
    }

        Phrase footerPhrase = new Phrase("Page "+writer.getPageNumber()+
            " of");
    footerPhrase.add(new Chunk(totalPages,0,0,true));

        ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, footerPhrase, 500, 65, 0);


    }

示例:

=SUBSTITUTE(SUBSTITUTE(A1,"systemTime",""), ":","")

答案 2 :(得分:0)

安装Cocoa Pods的步骤。

第1步 - 关闭安装pod文件的Xcode项目。和开放终端。

第2步 - 输入 cd 命令并拖动项目路径。

dra your project path

第3步 - 按Enter并输入 pod init conmmand然后打开您的项目文件夹,现在您可以看到pod文件

type pod init

you can see pod file in red mark open it

第4步 - 打开pod文件并写入您安装的pod名称

Enter pod name and save

第5步 - 保存并关闭pod文件并再次打开终端并编写 pod install 命令并等待几分钟安装pod

enter image description here

安装后,转到项目文件夹并打开.work空间文件并享受。

selected file is workspace file

现在pod安装享受和使用。