Trying to wrap the provider platform in cocoapod, but the compiler cannot find the headers

Hoping that someone had already decided this; I am trying to wrap a third-party library (Airwatch) in cocoapod for better control in our applications. However, I have time trying to get this to work. I created a block around a static library, but it's a dynamic structure, and I get damn time to compile it. Headings from the frame are simply not available in the containing application ....

Here is what I have already tried:

  • When I set vendored_libraries in podspec, I cannot access the headers with quotes or <>. Xcode just complains like "Not found"
  • Next, I tried to add the path to the headers in the framework as source_files, for example:

    s.source_files = 'Pod/Classes/**/*','Pod/Framework/AWSDK.framework/Versions/A/Headers/*.h'
    

This allows xcode to find the header to import, for example:

    import "AWSDKCore.h"  //Documented as the framework main header

But this creates an error for existing imports in the original structure:

enter image description here

I thought it was a bad idea, but I thought that I would try calling my cocoapod the same name as the Framework (which should contain the import path). Thus, this causes a lot of errors saying that some enumerations are either not declared or declared twice.

If anyone has thoughts, I will be forever magnificent ...

For reference only, here is my podspec:

Pod::Spec.new do |s|
 s.name             = "AirwatchSDK"
 s.version          = "0.1.0"
 s.summary          = "A short description of AirwatchSDK."

 s.homepage         = "https://github.com/<GITHUB_USERNAME>/AirwatchSDK"
 s.license          = 'MIT'
 s.author           = { "xxxxx" => "xxxx" }
 s.source           = { :git => "https://github.com/<GITHUB_USERNAME>/AirwatchSDK.git", :tag => s.version.to_s }

 s.platform     = :ios, '8.0'
 s.requires_arc = true
 #s.module_name = 'AWSDK'
 s.source_files = 'Pod/Classes/**/*','Pod/Framework/AWSDK.framework/Versions/A/Headers/*.h'

 s.vendored_frameworks = 'Pod/Framework/AWSDK.framework'
 s.frameworks = 'CFNetwork','CoreData','CoreFoundation','CoreGraphics','CoreLocation','CoreTelephony','CoreText'
 s.libraries = 'stdc++','z','sqlite3','c++'
end
+4
source share
1 answer

Since I understood my own answer, I thought I would post it here for the next guy ...

, , , "source_files" ( ). , , podspec vendored_framework source_files, :

#can't have source files if you want to access vendor framework
#s.source_files = 'Pod/Classes/**/*'

# airwatch framework.
s.vendored_frameworks = 'AWSDK.framework'
+9

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


All Articles