DaveWoodCom / XCGLogger

A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build XCGLogger 5.0.1 with Carthage: Fix => image not found

pappalar opened this issue · comments

Hi,

I know this is probably a misconfiguration on my side but since I updated to 5.0.1 with Carthage, I am unable to launch the app.

I actually noticed that we discussed this issue in #195, it is possible that some faulty commits have been brought over?

dyld: Library not loaded: @rpath/ObjcExceptionBridging.framework/ObjcExceptionBridging
Referenced from: /Users/Library/Developer/CoreSimulator/Devices/data/Containers/Bundle/Application//.app/Frameworks/XCGLogger.framework/XCGLogger
Reason: image not found

I do not have the framework in embedded binaries, (neither i had it with 4.0.0) because carthage asks to use a copy-framework script instead

It always worked before and all other frameworks are working fine.


UPDATE: I tested with a clean repository and I still encounter this issue.

You need to make sure ObjcExceptionBridging.framework is in your embedded binaries now. This is new with 5.0.1, the Objective-C methods had to be removed from the main framework in order to support the Swift Package Manager. I don't use Carthage myself, so I don't know if you need to do something extra to include that framework. There are shared schemes in the project for ObjcExceptionBridging, which I think is what you need.

Once you get it working, can you let me know what you had to change, so I can update the Readme for others?

Thanks.

See here as well, someone else had the same issue and resolved it just by adding the framework: #196 (comment)

ahhhh so you have a nested dependency! now that clears it 👍

So following this
https://github.com/Carthage/Carthage#nested-dependencies

you need to have a separate repo for ObjcExceptionBridging (it is a custom one?)

you need to add a Cartfile to the project,
include the path to the repo for ObjcExceptionBridging

Does adding the framework to the project manually not work? It would suck to have to create a whole new repo for it, since it's basically one header file.

So, I can see the framework in the Carthage build folder.

If I add it to:

  • the carthage Run Script phase where all frameworks are copied:
    /usr/local/bin/carthage copy-frameworks
    input:
    $(SRCROOT)/Carthage/Build/iOS/ObjcExceptionBridging.framework
  • to the linked Frameworks and Libraries

(same process that has to be done do for all other frameworks)
then it works.

however, by not having the dependency declared you are not stating clearly that it is a dependency

I think you can add the steps in the install guide for Carthage and then decide later.

Sooo, figured it out.

		core.dependency 'ObjcExceptionBridging'

Just like you included this as a core dependency for cocoapods, you need to do the same for Carthage.

PR incoming.

Well shit, cant figure out how to make Carthage do that.

adding $(SRCROOT)/Carthage/Build/iOS/ObjcExceptionBridging.framework to Input files fixes the issue, which is a manual step in Carthage anyways.
https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos

Merged into 5.0.2. Thanks for the PR.

This doesn't resolve the issue when building as a static framework since we can't add any search paths when compiler runs