Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional frameworks needed #263

Closed
angelolloqui opened this issue May 22, 2012 · 7 comments
Closed

Optional frameworks needed #263

angelolloqui opened this issue May 22, 2012 · 7 comments
Labels
t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it

Comments

@angelolloqui
Copy link
Contributor

I have an app that is using ShareKit with the Twitter Sharer. CocoaPods is adding the Twitter framework to the OTHER_LDFLAGS as follows:
OTHER_LDFLAGS = -ObjC -all_load -framework Twitter

The problem appears when I am trying to release the app, with iOS 4.2 deployment target.

When run in iOS 4.x the Twitter framework can not be loaded, and therefore the app closes during the starting process. To fix it, we need to mark frameworks as optional, but I don't know how to do this with the OTHER_LDFLAGS (is it possible? I couldn't find anything similar googling).

And the corresponding Device Log:

Hardware Model:      iPhone2,1
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-05-22 10:53:01.805 +0200
OS Version:      iPhone OS 4.3.3 (8J2)
Report Version:  104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Dyld Error Message:
  Library not loaded: /System/Library/Frameworks/Twitter.framework/Twitter
  Referenced from: /var/mobile/Applications/BB918653-EE0F-4CE1-A52A-9F95CD8A6DA5/XXXX.app/XXXX
  Reason: image not found
  Dyld Version: 191.3

Any idea how to fix this in CocoaPods installation?

For now I am going to delete the Twitter framework from the Pods.xcconfig file and include it manually (as optional), which I hope will work, but we should find a workaround for this because it will be present every time that a new framework appears.

Note: The app runs when starting from XCode, only crashes when installing the released ipa. It may make sense to you, but it does not to me :(

@alloy
Copy link
Member

alloy commented May 23, 2012

Yes, this will definitely have to be fixed.

fabiopelosin added a commit to CocoaPods/Specs that referenced this issue May 24, 2012
@fabiopelosin
Copy link
Member

Sorry I referenced the wrong issue :-(

@fabiopelosin
Copy link
Member

So this issue would be solved by adding an optional_frameworks attribute to the pod spec that result in frameworks being added as -weak_framework #{name}?

If that is the case also Xcodeproj::Config needs to be update to keep track of them.

@alloy
Copy link
Member

alloy commented Jun 6, 2012

We should probably name the attribute weak_frameworks instead of optional_frameworks, that makes a bit simpler to know what is going on.

@alloy
Copy link
Member

alloy commented Jul 12, 2012

@irrationalfab Isn’t the flag supposed to be -weak_framework (not plural)? See the framework programming guide.

@fabiopelosin
Copy link
Member

@alloy Ah, my bad. It should be fixed now.

fabiopelosin added a commit that referenced this issue Oct 25, 2014
@onmyway133
Copy link

@alloy I see that in target Build Settings, there are -framework UIKit and -weak_framework UIKit, why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it
Projects
None yet
Development

No branches or pull requests

4 participants