Use AdobeMobileLibrary (for iOS) with cocoapods?

We are going to use Omniture-Tracking for iOS, which is part of AdobeMobileLibrary. AdobeAdobeMobileLibrary is not available through cocoapods-repo (only an older version of Omniture), but as a static library that you can download from the Adobe website.

I wonder if it is possible to save this static library using cocoapods?

I created a podspec file:

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/*.{json,h}'
  s.ios.vendored_library = 'AdobeMobileLibrary/AdobeMobileLibrary.a'
  s.library        = 'AdobeMobileLibrary'
  s.xcconfig       = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/AdobeMobileLibrary"' }
end

In my podfile, I refer to the podspec file as s:

pod 'AdobeMobileLibrary', :path => 'AdobeMobileLibrary.podspec'

In the Pods project, I can see all the files (AdobeMobileLibrary.a, ADBMobile.h, ADBMobileConfig.json)

see http://i.stack.imgur.com/rnmp1.png

However, I cannot build the project and get this error message:

ld: library not found for -lAdobeMobileLibrary

Does anyone know what the problem is here?

Is there any other solution for using AdobeMobileLibrary with cocoapods?

+4
2

, cocoapods , lib, libAdobeMobileLibrary.a . - :

ln -s AdobeMobileLibrary.a libAdobeMobileLibrary.a

, Adobe Mobile SDK .json . SystemConfiguration, libSqlite3.0.dylib. pod :

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
+3

@fransen, prepare_command 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
+3

Source: https://habr.com/ru/post/1534265/


All Articles