Cocoapods: error: include of non-modular header inside framework module

Created on 13 Feb 2018  Â·  18Comments  Â·  Source: CocoaPods/CocoaPods

Report

What did you do?

Run pod spec lint

What did you expect to happen?

It should pass validation

What happened instead?

It spit out an error: "error: include of non-modular header inside framework module"

CocoaPods Environment

Stack

   CocoaPods : 1.4.0
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
    RubyGems : 2.6.12
        Host : Mac OS X 10.13.2 (17C88)
       Xcode : 9.2 (9C40b)
         Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /Users/saravanan_vij/.rvm/rubies/ruby-2.3.3/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ f7e4c263375bb1f4d8ae53852106237d09b7766a

Installation Source

Executable Path: /Users/saravanan_vij/.rvm/gems/ruby-2.3.3/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'SARUnArchiveANY' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  pod "UnrarKit"
  pod 'SSZipArchive', '~> 0.3.2'
  pod 'LzmaSDK-ObjC', :inhibit_warnings => true

  # Pods for SARUnArchiveANY

end

Project that demonstrates the issue

Here is the repo of the lib itself

Note: I've referred/tried several(this, this) other issues as well, but none of them seems to be working.
I've been trying to release a new pod version of this lib, but am stuck.
Any help would be appreciated. Thanks!

Most helpful comment

Man, you figured it.
Anyways, thanks for this lively help.
But, I suppose this should be there somewhere as part of the Cocoapods documentation so that not another whole day of someone is wasted again cause of it.

All 18 comments

In SARUnArchiveANY.h change #import "SSZipArchive.h" to #import <SSZipArchive/SSZipArchive.h>

This does not appear a cocoapods integration or library issue.

** BUILD SUCCEEDED **

I tried changing that as well. Still getting the same error.

It worked for me I was able to successfully lint. Remember pod spec lint actually clones the tag you have specified so its possible you are getting older code.

Try pod lib lint to ensure it passes locally as it did for me then add a tag and push the tag and then pod spec lint.

pod lib lint => Local
pod spec lint => Remote

I pushed the new tag(0.0.2) that's referred in podspec, but still I see this error:

cocoapods - lint error

Am I still missing something?

Does pod lib lint pass?

Because it does work for me.

Yes pod lib lint passed,
but pod spec lint is failing, and that's where I'm stuck.

I checked out the 0.0.2 and ran pod spec lint and worked for me.

    /usr/bin/codesign --force --sign - --timestamp=none /Users/dimitris/Library/Developer/Xcode/DerivedData/App-hfwziuempzrkueawtyozeivegnwx/Build/Products/Release-iphonesimulator/App.app

** BUILD SUCCEEDED **

I am on Xcode 9.2 and cocoapods 1.4.0. not sure whats going on here.

Not sure sir.
I'm still facing the same issue, I even tried cleaning up everything, but still no luck. It's very strange.
Any other suggestions?

Unfortunately no. I also can't come up with anything since it works for me using your actual project.

Try running pod spec lint --no-clean and then open the generated workspace and try to build there, check the file contents to ensure there is no caching occurs and maybe you get a different version of the source than you think.

Also use --verbose to see exactly what gets cloned.

I did try --verbose & --no-clean together.
Here's the log:

pod spec lint error.zip

When I look into:
"Pods workspace available at /var/folders/qk/365ky_714vx9mx0c3f1hbn3my8crpb/T/CocoaPods-Lint-20180214-6167-30t93i-SARUnArchiveANY/App.xcworkspace for inspection."

It has nothing, but still build succeeds. I'm not sure what it exactly does, though.

Can you try pod cache clean SARUnArchiveANY and try again?

It shouldnt have just nothing...there should be a Pods.xcodeproj in there and add the scheme for SARUnArchiveANY

Sure, I'll try that too.
P.S: I also tried re-starting tools and even my Mac, but still, it is throwing me the same error.
Pretty sure that I'm doing some silly mistake. But, not sure what.

OKAY... So, that was the issue.
Doing pod cache clean SARUnArchiveANY, SOLVED it.
So, Cocoapods internally has this cache and was not clearing up, right?

Most likely, probably a bad cache during your attempts to lint. Glad you figured it out.

Man, you figured it.
Anyways, thanks for this lively help.
But, I suppose this should be there somewhere as part of the Cocoapods documentation so that not another whole day of someone is wasted again cause of it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iosdev-republicofapps picture iosdev-republicofapps  Â·  3Comments

pronebird picture pronebird  Â·  3Comments

spencerkohan picture spencerkohan  Â·  3Comments

tlandsmancars picture tlandsmancars  Â·  3Comments

luhui picture luhui  Â·  3Comments