Creating a pod that rests on another block

An attempt to create a Cocoapod library, which depends on another published Cocoapod library that I own, launched a project in Xcode to build OK, but the pod lib lint command to verify the validity of the code fails with error: include of non-modular header inside framework module in library header files (pod) I am dependent on. All sources are Obj-C, not Swift.

I tried the following, in accordance with the recommendations found here

  • Setting dependent library header files as public instead of project
  • Setting CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES for each target
  • confirmation that the corresponding headers in the assembly phases are under public .

but the problem remains, I can not publish the file and not test it.

Update when I comment on s.dependency 'OldPodIDependOn' line in my podspec file of my new module, then the error disappears, but the dependent headers are not found. if I do not include pod I, depend on the Podfile in the ./Example folder, for example:

 target 'NewPod', :exclusive => true do pod "NewPod", :path => "../" pod "OldPodIDependOn", :path => "../../OldPodIDependOn/" end 

then the project simply will not be created in Xcode, as the OldPodIDependOn files OldPodIDependOn not part of the project. Got a bit of a problem with a chicken or an egg.

Update 2 Also tried to remove the component :path => "../../OldPodIDependOn/" to refer to content that was published instead of local - does not help.

It is worth mentioning that this module will include an interface, so the storyboard will be included and indicated, I added the line s.resources = 'Pod/Classes/UI/NewPod.storyboard' to the podspec file and deleted the storyboard from the original pod compilation sources (otherwise xcode will not create), I don’t think this has anything to do with the problem, but it’s worth mentioning, maybe I'm doing something wrong.

What am I doing wrong? Any help would be greatly appreciated!

+5
source share
3 answers

To finally solve this problem, I had to abandon the workspace created by pob lib create - there was no way around it, I tried all possible combinations / recommendations / code modifications to get rid of the "non-modular header inside the framework", but nothing worked . pod lib lint ALWAYS failed.

I created my own xcode project of the static library from scratch, and then ran pod update on it after adding the dependent pod to the Podfile , and then created the .podspec file for this library and added the dependent pod header files for the β€œCopy Files” build phase of the target static file target + libPods.a during the build phase of Link Binary with libs. Poof! no more "non-modular header" errors from pod lib lint , although I practically do the same. The lesson learned is that pod lib create not recommended for ALL coco port cases.

+4
source

I had the same problem and I used

 pod lib lint MyPod.podspec --allow-warnings --use-libraries 

When adding the -use-libraries option, this worked.

+2
source

In the general case, error: include of non-modular header inside framework module implies that one of the header files inside the resulting structure (CocoaPods lints for both frameworks and libraries now) is not stored inside the framework or is not classified as a public header.

This can usually be handled when moving external imports to implementation files, see this Modified for support using framework # 353 .

+1
source

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


All Articles