Use AdobeMobileLibrary (for iOS) with cocoapods?

夙愿已清 提交于 2019-12-03 16:16:11

The issue is due to cocoapods expecting the library to have a lib prefix, i.e. libAdobeMobileLibrary.a in this case. The easiest way to resolve this issue is to create a symbolic link to the library:

ln -s AdobeMobileLibrary.a libAdobeMobileLibrary.a

It's also worth noting that with the Adobe Mobile SDK, the .json file should be included as a resource not as source. Also you'll want to add references to both the SystemConfiguration framework as well as libSqlite3.0.dylib. Here's your pod spec modified accordingly:

Pod::Spec.new do |s| 
  s.name           = 'AdobeMobileLibrary'
  s.version        = '4.0.2'
  s.license        = 'Commercial'
  s.summary        = 'Adobe Omniture SiteCatalyst analytics library for iOS.'
  s.homepage       = 'https://developer.omniture.com/en_US/content_page/mobile/c-measuring-   mobile-applications'
  s.author         = { 'Adobe Omniture SiteCatalyst' => 'http://www.adobe.com/solutions/digital-marketing.html' }
  s.source_files   = 'AdobeMobileLibrary/*.h'
  s.resource       = 'AdobeMobileLibrary/ADBMobileConfig.json'
  s.framework      = 'SystemConfiguration'
  s.ios.vendored_library = 'AdobeMobileLibrary/AdobeMobileLibrary.a'
  s.libraries      = 'sqlite3.0','AdobeMobileLibrary'
  s.xcconfig       = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/AdobeMobileLibrary"' }
end
devxoul

To be more generic for @fransen's solution, I used prepare_command and preserve_paths:

Pod::Spec.new do |s| 
  s.name           = 'AdobeMobileLibrary'
  s.version        = '4.0.2'
  s.license        = 'Commercial'
  s.summary        = 'Adobe Omniture SiteCatalyst analytics library for iOS.'
  s.homepage       = 'https://developer.omniture.com/en_US/content_page/mobile/c-measuring-   mobile-applications'
  s.author         = { 'Adobe Omniture SiteCatalyst' => 'http://www.adobe.com/solutions/digital-marketing.html' }
  s.source_files   = 'AdobeMobileLibrary/*.h'
  s.resource       = 'AdobeMobileLibrary/ADBMobileConfig.json'
  s.framework      = 'SystemConfiguration'
  s.preserve_paths = 'AdobeMobileLibrary/libAdobeMobileLibrary.a'
  s.ios.vendored_library = 'AdobeMobileLibrary/AdobeMobileLibrary.a'
  s.prepare_command  = <<-CMD
             if [ -f $PWD/AdobeMobileLibrary/libAdobeMobileLibrary.a ]
             then
                 rm -rf $PWD/AdobeMobileLibrary/libAdobeMobileLibrary.a
             fi
             ln -s $PWD/AdobeMobileLibrary/AdobeMobileLibrary.a $PWD/AdobeMobileLibrary/libAdobeMobileLibrary.a
                          CMD
  s.libraries      = 'sqlite3.0'
  s.xcconfig       = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/AdobeMobileLibrary"' }
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!