Integrating to existing project using carthage - already have cocoa lumberjack in use

Issue #7 resolved
Chris Searle created an issue

Hi there,

Asked papertrail - they suggested asking here instead.

Trying to add papertrail to an existing carthage project that already uses cocoa lumberjack.

We're in XCode 8, targetting iOS 9 and later.

So - I edited the cartfile with one addition for papertrail (the other lines are from before):

github "CocoaLumberjack/CocoaLumberjack" ~> 2.4.0
github "jdg/MBProgressHUD" ~> 1.0.0
github "akashivskyy/GoogleAnalytics-Framework" ~> 3.1.7
github "dennisweissmann/DeviceKit" ~> 0.3.5
git "https://bitbucket.org/rmonkey/papertraillumberjack.git"

I then do the carthage build and it builds fine.

I used carthage update --no-use-binaries (but had the same issue without that switch).

I then drag the frameworks from the carthage build directory into the "Link Binary With Libraries" section and add both PapertrailLumberjack and CocoaAsyncSocket to the copy-frameworks script step for carthage.

This now runs fine on a development device and posts to papertrail from the device.

The issue hits at appstore submission.

It fails with reports of duplicate libraries and also that there is a directory with the forbidden name "Frameworks".

When I look at the build this is what I see inside the generated .app file:

/Frameworks/CocoaAsyncSocket.framework/
/Frameworks/CocoaLumberjack.framework/
/Frameworks/CocoaLumberjackSwift.framework/
/Frameworks/DJISDK.framework/
/Frameworks/DeviceKit.framework/
/Frameworks/GoogleAnalytics.framework/
/Frameworks/MBProgressHUD.framework/
/Frameworks/PaperTrailLumberjack.framework/
/Frameworks/PaperTrailLumberjack.framework/Frameworks/CocoaAsyncSocket.framework/
/Frameworks/PaperTrailLumberjack.framework/Frameworks/CocoaLumberjack.framework/
/Frameworks/PaperTrailLumberjack.framework/Frameworks/CocoaLumberjackSwift.framework/

You can see that the three libraries are repeated and the Frameworks directory is present - both of which cause app submission to fail.

Any ideas what I should change to get this to work both local and also able to be submitted to the app store?

Comments (9)

  1. George Malayil

    Thanks for reporting this. I have merged the referenced pull request into master. Could you check to see if this resolves your issue with App Store submissions? Thanks

  2. Chris Searle reporter

    Hmm. Still seeing the frameworks directory in the built app (set the carthage line to pull HEAD and cleared out the Carthage directory so I'm fairly sure it's not a caching issue).

    I'll check out this project locally later today and see if I can see why. Will get back to you.

  3. George Malayil

    I could be wrong on this, and, will try to investigate some more later this evening. My thoughts on this is

    1. The PR that was merged should prevent a Frameworks directory being created inside the Papertraillumberjack.framework. Are you seeing differently?
    2. I think the frameworks directory should be allowed inside your app's bundle. I believe all the linked frameworks - Cocoalumberjack, Papertraillumberjack, DeviceKit, etc. will go in here. Unless, Apple has a different location for frameworks now

    Thanks

  4. Chris Searle reporter

    1

    So - I first removed everything in Carthage/* AND the Cartfile.resolved file.

    Added the following line to my Cartfile

    git "https://bitbucket.org/rmonkey/papertraillumberjack.git" "HEAD"
    

    (have to put HEAD or I get 0.1.6).

    Then I ran

    carthage bootstrap --no-use-binaries --platform ios
    

    Ran bootstrap instead of update because I'd removed the Cartfile.resolved file.

    Then in XCode I dragged in the frameworks and set up the copy-frameworks step.

    Cleaned and built.

    It runs fine still on a development device but I can still see the extra frameworks directory in the built app (show package contents).

    This may well be something I'm doing wrong - I'm going to have another go this evening.

    2

    The app bundle gets a Frameworks directory in its root - that's where all the frameworks go - that's correct.

    But - I get a nested frameworks directory inside Papertraillumberjack.framework - that's the one app submission complains about.

    If we can fix #1 so that the extra frameworks directory isn't created then this will also fix #2 :)

  5. George Malayil

    Hmm..So, I just tried this out, after deleting my Carthage folder (with build and checkouts) and the Cartfile.resolved

    Added the following line to my Cartfile

    git "https://bitbucket.org/rmonkey/papertraillumberjack.git" "HEAD"
    

    Then I ran

    carthage update
    
    ls Carthage/Build/iOS/PaperTrailLumberjack.framework
    ls Carthage/Build/Mac/PaperTrailLumberjack.framework
    

    I don't see a nested frameworks directory in either location.

    If you could check, if the nested frameworks directory shows up at this point of the build process, it would be great.

    Thanks

  6. Chris Searle reporter

    This is really odd.

    rm -rf Cartfile.resolved Carthage/*
    

    Ran carthage

    And this is what I see built

    $ ls Carthage/Build/iOS/PaperTrailLumberjack.framework
    Frameworks/     Headers/        Info.plist      Modules/        PaperTrailLumberjack*
    
    $ ls Carthage/Build/iOS/PaperTrailLumberjack.framework/Frameworks
    CocoaAsyncSocket.framework/ CocoaLumberjack.framework/  CocoaLumberjackSwift.framework/
    

    So - that prompted me to look at the newly generated Cartfile.resolved

    github "robbiehanson/CocoaAsyncSocket" "f34134f7d14125370caf54b45dcb32d77b3ce38c"
    github "CocoaLumberjack/CocoaLumberjack" "2.4.0"
    github "dennisweissmann/DeviceKit" "0.3.5"
    github "jdg/MBProgressHUD" "1.0.0"
    github "jspahrsummers/xcconfigs" "0.10"
    github "akashivskyy/GoogleAnalytics-Framework" "3.17"
    git "https://bitbucket.org/rmonkey/papertraillumberjack.git" "54d20360079f5450cc40dc61e02b6ad130be3f18"
    

    Now - 54d20360079f5450cc40dc61e02b6ad130be3f18 is the 0.1.6 build.

    I have absolutely no idea why putting HEAD into the Cartfile is getting an older commit right now - but I tested putting in commit 2162da6a9331802a8e8ae1a9324962be640fa976 explicitly

    With that in place - the same rebuild worked with no generated frameworks directory and it still logs to papertrail from a dev device.

    So - the fix seems to be working - just that carthage for some reason didn't pick up the HEAD commit until I put the commit sha in directly.

    I'd say that this was ready for tagging 0.1.7 :)

  7. Log in to comment