Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing required module 'CocoaLumberjack' in iOS 8 app / framework

I'm having a problem with integrating a cocoa pod (CocoaLumberjack in this case) into an iOS app and my own frameworks.

The Podfile looks like this:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.0"

target "CommonModule" do
    use_frameworks!
    # CocoaLumberjack wasn't officially released with Swift support yet
    # pod 'CocoaLumberjack'
    pod 'CocoaLumberjack', :git => '[email protected]:CocoaLumberjack/CocoaLumberjack.git', :commit => '6882fb5f03696247e394e8e75551c0fa8a035328'
    xcodeproj 'CommonModule/CommonModule.xcodeproj'
end

I have a hierarchy of modules (dynamic frameworks) like this:

  • CommonModule
  • ModelsModule (has a dependency CommonModule)

And finally, the main app:

  • MySwiftApp (dependency both ModelsModule and CommonModule)

Now, CocoaLumberjack is used in several files in CommonModule and works as expected. However, every time I do import CommonModule in any file in ModelsModule, I get the following compile error:

~/Developer/ModelsModule/ModelsModule/SomeFile.swift:2:8: error: missing required module 'CocoaLumberjack'
import CommonModule
       ^

Any idea how to solve this issue?

UPDATE: Some people Recommend to use Carthage. I would like to avoid that, if possible.

like image 516
Tom Kraina Avatar asked Dec 05 '25 09:12

Tom Kraina


1 Answers

You'll also need to ensure that CommonModule.framework and CocoaLumberjack.framework (and any other frameworks) are listed in the Embedded Binaries section of your application target.

All the new iOS 8-style dynamic frameworks must be embedded within your app—even those that you aren't using directly, but that are dependencies of your dependencies—so you might end up seeing references to items you don't recognize.

Incidentally, there is a new Swift-based logging engine called CleanroomLogger that might make things easier if you're having trouble interacting with CocoaLumberjack from Swift.

like image 92
emaloney Avatar answered Dec 07 '25 23:12

emaloney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!