Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import errors with use_frameworks! #126

Closed
SSheldon opened this issue Feb 27, 2016 · 1 comment
Closed

Import errors with use_frameworks! #126

SSheldon opened this issue Feb 27, 2016 · 1 comment

Comments

@SSheldon
Copy link
Contributor

If you try to install KSCrash via CocoaPods with use_frameworks!, in a Podfile like this:

platform :ios, '8.0'
use_frameworks!

target 'PodsTest' do
  pod 'KSCrash', :git => '[email protected]:kstenerud/KSCrash.git', :tag => '1.0.2'
end

You'll get an error like this one:

While building module 'KSCrash':
In file included from <module-includes>:1:
KSCrash/KSCrash.framework/Headers/KSCrash-umbrella.h:19:9: fatal error: 'KSCrashAdvanced.h' file not found
#import "KSCrashAdvanced.h"
        ^
1 error generated.
fatal error: could not build module 'KSCrash'
#import <KSCrash/KSCrash.h>
 ~~~~~~~^

This appears to have started happening with #124, and to the best of my understanding it seems to be caused because the KSCrash/Recording/Advanced subspec marks some headers as public, but those headers aren't part of the source_files of the spec. (public_header_files is expected to be a subset of source_files, which I learned from CocoaPods/CocoaPods#4936.) Including these headers as source_files seems to fix the problem.

After fixing that, there's also a second issue if you try to use just the Recording subspec:

While building module 'KSCrash':
In file included from <module-includes>:1:
In file included from KSCrash/KSCrash.framework/Headers/KSCrash-umbrella.h:3:
KSCrash/KSCrash.framework/Headers/KSCrash.h:31:9: fatal error: 'KSCrashReportFilter.h' file not found
#import "KSCrashReportFilter.h"
        ^
1 error generated.
fatal error: could not build module 'KSCrash'
#import <KSCrash/KSCrash.h>
 ~~~~~~~^

This one's a bit more straightforward, KSCrashReportFilter.h wasn't included as a public header for the Recording subspec. Adding it fixes the problem.

PR to fix both of these incoming!

@SSheldon
Copy link
Contributor Author

Oh actually the KSCrashReportFilter.h issue isn't framework-specific, it happens with static libs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant