Skip to content

Can not compile with Swift as a framework  #49

Open

Description

@pedropalmero

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

Activity

  1. hartbit commented on Jul 8, 2015

    @hartbit

    👍

  2. iosdevzone commented on Sep 23, 2015

    @iosdevzone
    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.

  3. cezheng commented on Nov 2, 2015

    @cezheng
    Contributor

    #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.

  4. jasperblues commented on Nov 2, 2015

    @jasperblues
    Member

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

  5. cezheng commented on Nov 2, 2015

    @cezheng
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions