-
Notifications
You must be signed in to change notification settings - Fork 417
Cocoapods Link Error: __FBTweakIdentifier (with custom build configuration) #4
Comments
Hm, __FBTweakIdentifier is a macro so it shouldn't need to link. Let me try it and see if I can reproduce. |
FYI my code works as expected when I drop in the source files directly into my project, so I'm leaning towards a Cocoapods config issue, but I don't know how to debug it really. |
I have a similar issue, but I can run in simulator and on debugging device. When I want to archive for a testflight build (to send to customer for testing), then the Linker Error happens:
and also
and also
I'm using cocoapods also and FB_WEAK_ENABLED is set to 1 in the Preprocessor Macros. One thing I found is that ARC is turned off in the build settings for the Pods-Tweaks target, but turning it on, didn't help. |
Checked also without Cocoapods (just moved the FBTweak dir into the project) and everything builds fine. I agree with @LeffelMania on probably being a Cocoapods config issue. |
Investigated some at the Cocoapods task: CocoaPods/CocoaPods#1934 It seems to be a conflict between how Cocoapods projects are configured, how configurations are propagated, and the macros that Tweaks relies on. Still looking into how to best solve it. |
@grpaul as @alloy explained in CocoaPods/CocoaPods#1934 the app project and the Pods project macros have to be in line. This is why sometimes when using custom build configurations Tweaks doesn't link, the macros used by the Pods project to compile Tweaks are different from the ones used by the app project. I updated my example repo with a Podfile that compiles. Wrapping it up:
In case you are not checking in your post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == "Pods-TweaksBuildConfigurationsDemo-Tweaks"
target.build_configurations.each do |config|
if config.name == 'QA'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'FB_TWEAK_ENABLED=1']
end
end
end
end
end What it does is adding |
Should be good to close this now, but nice to have a great explanation to point anyone to who hits this issue! |
Maybe we can update the README? On Wednesday, April 16, 2014, Grant Paul notifications@github.com wrote:
Giò "Be a yardstick of quality. Some people aren't used to an environment |
Note: FB_TWEAK_ENABLED, not FB_TWEAKS_ENABLED |
It looks like with Cocoapods v0.38.2 hook should look like post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
if target.name == "Tweaks"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'FB_TWEAK_ENABLED=1']
end
end
end
end |
* .catalog.yml file is added to the repo. * Catalog file is updated. * Update .catalog.yml * Update .catalog.yml
Trying to get set up with Tweaks, added the pod to my podfile:
pod 'Tweaks'
Got the
FBTweakShakeWindow
integrated and displaying 0 items (as expected), went to add my first tweak as such:self.alpha = FBTweakValue(@"Category", @"Thing", @"Alpha", .6, 0.1, 1.0);
When I went to build I got a Linker Error:
Undefined symbols for architecture i386: "__FBTweakIdentifier"
I see the
extern
s defined inFBTweakInline.m
andFBTweakinlineInternal.h
, but I can't get this resolved.Any suggestions on what I might have missed or what the problem might be?
Many thanks.
The text was updated successfully, but these errors were encountered: