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

Can not compile with Swift as a framework #49

Open
pedropalmero opened this issue Jul 2, 2015 · 5 comments
Open

Can not compile with Swift as a framework #49

pedropalmero opened this issue Jul 2, 2015 · 5 comments

Comments

@pedropalmero
Copy link

I'm using cocoapods in a MacOSX command line app with this Podfile:

# Uncomment this line to define a global platform for your project
platform :osx, '10.8'

use_frameworks!

target 'EventwoCreateApp' do
    pod 'GBCli'
    pod 'XcodeEditor'
end

When i try to build the project, it fails building because of including of non-modular header inside framework module

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Users/pedro/Library/Developer/Xcode/DerivedData/EventwoCreateApp-hbqavnbhqvzppravjjsvpcdoxdwl/Build/Products/Debug/Pods-EventwoCreateApp/XcodeEditor.framework/Headers/Pods-EventwoCreateApp-XcodeEditor-umbrella.h"
        ^
/Users/pedro/Library/Developer/Xcode/DerivedData/EventwoCreateApp-hbqavnbhqvzppravjjsvpcdoxdwl/Build/Products/Debug/Pods-EventwoCreateApp/XcodeEditor.framework/Headers/Pods-EventwoCreateApp-XcodeEditor-umbrella.h:20:9: note: in file included from /Users/pedro/Library/Developer/Xcode/DerivedData/EventwoCreateApp-hbqavnbhqvzppravjjsvpcdoxdwl/Build/Products/Debug/Pods-EventwoCreateApp/XcodeEditor.framework/Headers/Pods-EventwoCreateApp-XcodeEditor-umbrella.h:20:
#import "XCKeyBuilder.h"
        ^
/Users/pedro/Library/Developer/Xcode/DerivedData/EventwoCreateApp-hbqavnbhqvzppravjjsvpcdoxdwl/Build/Products/Debug/Pods-EventwoCreateApp/XcodeEditor.framework/Headers/XCKeyBuilder.h:14:9: error: include of non-modular header inside framework module 'XcodeEditor.XCKeyBuilder'
#import <CommonCrypto/CommonDigest.h>
        ^
/Users/pedro/Downloads/EventwoCreateApp/EventwoCreateApp/AppCreator.swift:10:8: error: could not build Objective-C module 'XcodeEditor'
import XcodeEditor

I've tried different solutions, like customizing the modulemap file or adding the framework to the target, but the error is always the same.

¿is there some solution or is it simply a swift limitation?, thanks

@hartbit
Copy link

hartbit commented Jul 8, 2015

👍

@iosdevzone
Copy link
Contributor

I had the same problem and issued a pull request to solve it (#53). This request was merged in commit 9f1a7e6. So you should be able to compile as a framework now.

If you are using Swift 2.0 #54 adds lightweight generics which reduces the amount of casting you need to do.

@cezheng
Copy link
Contributor

cezheng commented Nov 2, 2015

#60 has make XcodeEditor able to be nicely integrate with Carthage into Swift projects(the project did not set define modules to be Yes, so previously after linking the framework you still need to add necessary headers to the bridging headers).

I haven't tested Cocoapods yet, but it's totally fine with Carthage.

@jasperblues
Copy link
Member

@iosdevzone @cezheng Shall we tag a new version and close this issue off?

@cezheng
Copy link
Contributor

cezheng commented Nov 2, 2015

@jasperblues Maybe better to make sure that Cocoapods is fine(not sure if podspec would need an update or not since Carthage reads the xcodeproj's header settings but Cocoapods does not), but currently I don't have a mac at hand to check this out.

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

5 participants