使用GoogleMaps SDK构建Cocoapod库

时间:2016-03-22 12:19:07

标签: ios swift cocoapods google-maps-sdk-ios podspec

我想在My Cocoapod库中使用GoogleMaps

GoogleMaps in cocoapod。但是,您无法使用dependency,因为它是静态库。大概...

我引用了这个答案 Building a Cocoapod with Swift and dependency on Objective-C framework
而且,建筑图书馆也成功了。

在示例项目中使用构建库时遇到问题。

当我构建Example项目时,第一个问题是

  

ld:未找到框架架构arm64的GoogleMaps

并且,我尝试将GoogleMaps添加到示例项目的Podfile 下一个问题是

  

' Pods-MapLibraryWrapper_Example'目标有框架   名称冲突:GoogleMaps。

有没有办法解决这个问题?或者,还有其他方法可以使用GoogleMaps吗?

感谢。

我的图书馆的一部分podspec。

  s.platform     = :ios, '8.0'
  s.requires_arc = true

  s.source_files = 'Pod/Classes/**/*'
  s.resource_bundles = {
    'MapLibraryWrapper' => ['Pod/Assets/*.png']
  }
  s.ios.resource_bundle = { 'MapLibraryWrapper-ios' => 'Resources/*.png' }

  s.public_header_files = 'Pod/Classes/**/*.h'
  s.frameworks = "Accelerate", "AVFoundation", "CoreData", "CoreLocation", "CoreText", "Foundation", "GLKit", "ImageIO", "OpenGLES", "QuartzCore", "SystemConfigurati\
on", "GoogleMaps"
  # s.dependency 'GoogleMaps'
  s.libraries = "c++", "icucore", "z"
  s.vendored_frameworks = 'Dependencies/GoogleMaps.framework'

  s.prepare_command = './download-googlemaps.sh'

目录结构

$(project_root)
    |- MapLibraryWrapper.podspec
    |- Dependencies/
        |- GoogleMaps.framework
    |- Example
        |- Podfile

实施例/ Podfile

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'MapLibraryWrapper_Example', :exclusive => true do
  pod 'MapLibraryWrapper', :path => '../'
  pod 'GoogleMaps'
end

target 'MapLibraryWrapper_Tests', :exclusive => true do
  pod 'MapLibraryWrapper', :path => '../'

  pod 'Quick', '~> 0.8.0'
  pod 'Nimble', '3.0.0'
end

0 个答案:

没有答案