Closed wimhaanstra closed 8 years ago
Just a couple of test results, might help you out, I tried this on an my original project and an empty test project:
MR 2.2.0
with CocoaLumberjack 2.0.0 : SucceedsMR 2.3.0-beta.5
with CocoaLumberjack 2.0.0 : FailsMR 2.3.0-beta.6
module-support
-branch with CocoaLumberjack 2.0.0 : FailsI've just made some changes to the module-support branch that I hope (haven't had a chance to properly test yet) will fix CocoaLumberjack support. Would you mind having a look for me as well? Thanks!
Feel free to re-open this issue if it isn't fixed.
@tonyarnold I'm running into the same issue (Undefined symbols for "_OBJCCLASS$_DDLog")
use_frameworks!
pod 'MagicalRecord', '2.3.0'
pod 'CocoaLumberjack', '2.0.0'
The module-support branch is no longer there so I can't comment on that.
Same issue here. I used @depl0y solution as work around, not sure if it's the right way to go..?
I'm having the same issue here as well. My podfile looks like this
platform :ios, '8.0'
target '[App Name]' do
use_frameworks!
pod "MagicalRecord", "~> 2.3.0"
pod 'CocoaLumberjack', :git => "https://github.com/CocoaLumberjack/CocoaLumberjack.git", :branch => "swift_support"
end
I'm using the swift_support
branch of CocoaLumberjack as suggested on their repo, which uses version 2.0.0.
Linking the framework in the Pods-[App Name]-MagicalRecord
target like @depl0y suggested allows me to build, but seems pretty fragile since I'd need to remember to do that each time I run pod install
.
Having the same problem as well
Same issue.
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
platform :'ios', '7.0'
xcodeproj '<proj1>'
link_with 'target1'
xcodeproj '<proj2>'
link_with 'target2_1'
link_with 'target2_2'
pod 'AFNetworking'
pod 'CocoaLumberjack'
pod 'MagicalRecord'
target :<...>Tests do
pod 'OCMock', '~> 3.0.2'
pod 'XCAsyncTestCase'
end
Putting in my 2 cents as well (cc @ssoper)
Any update on this? it's the same issue here
No update. I haven't been using MR in any projects recently, and I haven't had the opportunity to work on it outside of hours. I'm happy to accept pull requests toward this issue.
same here, any info about this issue?
Using CocoaLumberjack (2.0.1) Using MagicalRecord (2.3.0)
Works well ( as @depl0y mentioned above )
CocoaLumberjack (2.0.0)
MagicalRecord (2.2.0)
Issue not reproducing if async logging in CocoaLumberjack is disabled. But you need to create fork of CocoaLumberjack pod for this.
Any updates on this ?
Why is this closed? Isn't it still an issue?
Still having problems with this. Any updates?
Same issue here: pod 'CocoaLumberjack', '~> 2.0' pod 'MagicalRecord', '~> 2.3'
Ok, I found a workaround. The problem is, that the MagicalRecord Target doesn't link with the CocoaLumberjack Framework. (Build Phases >> Link Binary With Libraries) When one adds CocoaLumberjack as optional dependency, all works great.
Hey Melbic, are you adding the dependency to cocoa lumberjack from Magical Record? If so then I've used this trick as a workaround too. The only issue is that every time you do a 'pod install' the dependency is wiped out. Still hoping for a permanent solution...
Take a look at my pull request. Using that to install MagicalRecord it works without manually linking the framework.
does this error appears in Swift-based projects?
Yes.
@pratik6554 and this error still exists?
In my case:
cocoapods 0.39.0
cocoalumberjack 2.1.0
magicalrecord 2.3.0
xcode 7.1
And error occurs.
I use @melbic approach and add cocoalumberjack as optional dependency - everything works fine
@lolgear Facing same issue for
pod 'MagicalRecord', '~> 2.3.0' pod 'CocoaLumberjack/Swift'
I have improved podspec a little bit in #1132 so subspec with CocoaLumberjack is selected automatically
Just in case it helps anyone, here's the workaround I used.
In my Pod's Podspec file:
s.dependency 'MagicalRecord', '~> 2.3.0'
s.dependency 'CocoaLumberjack', '~> 2.0'
s.pod_target_xcconfig = { CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
In the actual project's Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'MagicalRecord'
target.build_configurations.each do |config|
config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)', '-framework "CocoaLumberjack"']
end
end
end
end
This seems to work without having to adjust build settings every time I run pod install
.
P.S.: I'm not an expert on CocoaPods and/or Ruby, so if you see an error in the post_install script or know a way of including it directly in the Podspec file, feel free to comment.
P.P.S.: Let's hope MagicalRecord 2.4.0 CocoaPod contains the CocoaLumberjack subspec and this is no longer needed :)
Cocoa lumberjack has never been a requirement for magical record or logging to work and compile. Magical record was designed to simply connect to the logging framework if it was available.
Sent from my iPhone
On Dec 9, 2015, at 8:42 AM, Frantisek Vymazal notifications@github.com wrote:
Just in case it helps anyone, here's the workaround I used.
In my Pod's Podspec file:
s.dependency 'MagicalRecord', '~> 2.3.0' s.dependency 'CocoaLumberjack', '~> 2.0' s.pod_target_xcconfig = { CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' } In the actual project's Podfile:
post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'MagicalRecord' target.build_configurations.each do |config| config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)', '-framework "CocoaLumberjack"'] end end end end This seems to work without having to adjust build settings every time I run pod install.
P.S.: I'm not an expert on CocoaPods and/or Ruby, so if you see an error in the post_install script or know a way of including it directly in the Podspec file, feel free to comment.
P.P.S.: Let's hope MagicalRecord 2.4.0 CocoaPod contains the CocoaLumberjack subspec and this is no longer needed :)
— Reply to this email directly or view it on GitHub.
Exactly! And since it's not a requirement (and therefore the pod's dependency), it's not linked in by default. This is what's causing the headache - the conditional compile sees the CocoaLumberjack header, imports it and starts using it, but in the link phase, the library is not added, causing the _(Undefined symbols for "OBJC_CLASS$DDLog") error.
Just to be clear - my comment wasn't meant to be confrontational. Apparently, this has already been fixed in the master branch by the subspec. Unfortunately, this change has not yet propagated into the CocoaPods repo.
And since I'm not allowed to use the :git option in Podspec, I'm dependant on the main repo. With my workaround, I was just trying to help other people in the same situation :)
@frenya this post install fix doesn't work for me in my application's podfile
Also seeing this
pod 'MagicalRecord', '2.3.0'
pod 'CocoaLumberjack', '2.2.0'
Same for me
Using CocoaLumberjack (2.2.0)
Using MagicalRecord (2.3.0)
There is a solution for this problem (https://github.com/magicalpanda/MagicalRecord/pull/1101) It was merged into the main repo but for some reason not yet submitted to CocoaPods master specs repo. In order to fix linker issue update the podfile entry to:
pod "MagicalRecord/CocoaLumberjack", :git => "https://github.com/magicalpanda/MagicalRecord.git"
P.S. I have not tried this with Swift.
@anton-matosov Checked with swift, working fine.
Sorry guys, I've been swamped — I released version 2.3.2 a couple of days ago, which should address this issue. Feel free to reopen this issue if it doesn't.
Version 2.3.2 from branch MagicalRecord/CocoaLumberjack works for me. However, the default podspec when using "pod 'MagicalRecord' doesn't work for me. Both show version 2.3.2, though... weird.
After fixing the Undefined symbols issue by installing from 'MagicalRecord/CocoaLumberjack' I start seeing these other errors.
Any ideas on what might be going on?
I still have the issue with the default podspec using 'pod MagicalRecord'. It shows version 2.3.2 too..
Default podspec should not fix the issue. CocoaLumberjack is optional component and if you use it, you should use another subspec
In fact I wasn't using it. I installed the appodeal pod, then the issue appeared. Even uninstalling the appodeal pod didn't solve the problem. I solved it deleting derived data folder. Thanks!
I upgraded my project to use Cocoapods 0.36 and I started to fix the errors that causes. One of the errors I was getting is the following:
In my project I have both CocoaLumberjack as MagicalRecord in my Podfile. I solved it by adding
CocoaLumberjack.framework
to theLink Binary With Libraries
in the Pods-MagicalRecord target my Pods project has, but I am not sure that is the way to go.