twitter-kit-ios
twitter-kit-ios copied to clipboard
Change packaging form for proper handling of static frameworks using CocoaPods 1.4.0
Bug Report
- TwitterKit/TwitterCore Version Number: 3.3.0/3.1.0
- CocoaPods 1.4.0.rc.1
Hey!
This will be more of descriptive issue of things i think i found out today while integrating TwitterKit into my app.
My setup of a project is as follows: there is a framework, that contains most of the code, and app target which depends on it. I use CocoaPods for both targets, and integrate TwitterKit/TwitterCore into framework target.
When running the app, multiple warnings like this jump out in console:
objc[93428]: Class TWTRScribeService is implemented in both /Users/Denys/Library/Developer/CoreSimulator/Devices/CA2742B8-22F4-4C6B-8A09-8870838ACCEF/data/Containers/Bundle/Application/BAD2EE63-C5FF-4E07-A296-2BE29E4FB060/DocDebug.app/Frameworks/TwitterKit.framework/TwitterKit (0x1089ef148) and /Users/Denys/Library/Developer/CoreSimulator/Devices/CA2742B8-22F4-4C6B-8A09-8870838ACCEF/data/Containers/Bundle/Application/BAD2EE63-C5FF-4E07-A296-2BE29E4FB060/DocDebug.app/Frameworks/TwitterCore.framework/TwitterCore (0x108866f70). One of the two will be used. Which one is undefined.
objc[93428]: Class TWTRUserAuthRequestSigner is implemented in both /Users/Denys/Library/Developer/CoreSimulator/Devices/CA2742B8-22F4-4C6B-8A09-8870838ACCEF/data/Containers/Bundle/Application/BAD2EE63-C5FF-4E07-A296-2BE29E4FB060/DocDebug.app/Frameworks/TwitterKit.framework/TwitterKit (0x1089ef1c0) and /Users/Denys/Library/Developer/CoreSimulator/Devices/CA2742B8-22F4-4C6B-8A09-8870838ACCEF/data/Containers/Bundle/Application/BAD2EE63-C5FF-4E07-A296-2BE29E4FB060/DocDebug.app/Frameworks/TwitterCore.framework/TwitterCore (0x108866fe8). One of the two will be used. Which one is undefined.
After several hours of research i came into conclusion that reason for that is TwitterKit is compiled as static library and then imported into TwitterKit dynamic library, which is distributed using CocoaPods vendored_framework instruction. It seems that CocoaPods 1.4.0 introduces proper support for distributing static library without such shenanigans, as described in this blog post: https://github.com/CocoaPods/blog.cocoapods.org/pull/147/files
I'm not sure what the next steps would be and how PR to change this should be formed, as clearly this changes how framework can be distributed by Twitter team and requires some changes in Xcode projects e.t.c.
So this issue is more to start discussion about this and spread this information around. There are multiple issues on CocoaPods, that have some helpful information on this topic, just listing them here in case they are helpful:
https://github.com/CocoaPods/CocoaPods/issues/7126 https://github.com/CocoaPods/CocoaPods/issues/5768
I want to also note, that this problem also exists if you install TwitterKit into main target of the application, so it's not exclusive to setup with framework target.
I just install TwitterKit (3.3.0) using Cocoapods 1.3.1 on Xcode 9.2 and I can reproduce the same multiple warnings when the app start running.
@DenHeadless did you found a solution?
No, unfortunately. Everything I've written in original description seems to be relevant and needs to be looked into by Twitter folks.
The same problem for me. About 40-50 similar logs like: Class TWTRScribeService is implemented in both /private/var/containers/Bundle/Application/14EBC203-1D7F-4176-B6BA-4792C1512BBC/myApp.com/Frameworks/TwitterKit.framework/TwitterKit (0x105955330) and /private/var/containers/Bundle/Application/14EBC203-1D7F-4176-B6BA-4792C1512BBC/myApp.com/Frameworks/TwitterCore.framework/TwitterCore (0x10568cc88). One of the two will be used. Which one is undefined. Maybe someone knows, how can I just turn off these logs ?
is there no progress on this issue? its been three months since this was open. Am facing the same issue
Agree with you, guys. I have the same problem. How long should I wait updating TwitterKit?
All I wanna say is that they don't really care about us.
Still no update :<
I am getting the same warnings
same warnings :(
fix needed
same warnings, please help
I've fixed this by removing manually frameworks from OTHER_LDFLAGS from Pods-YourCoolTargetName.debug.xcconfig and Pods-YourCoolTargetName.release.xcconfig
Confirming @astrokin's fix. OTHER_LDFLAGS in my Pods-<mytargetname>.debug.xcconfig and Pods-<mytargetname>.release.xcconfig files included:
-framework "TwitterCore" -framework "TwitterKit"
Changing both files to just:
-framework "TwitterKit"
eliminated the runtime warnings.
is there no progress on this issue? its been three months since this was open. Am facing the same issue