Optional frameworks needed #263

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

Comments

Projects
None yet
4 participants
@angelolloqui
Contributor

angelolloqui commented May 22, 2012

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

This comment has been minimized.

Show comment Hide comment
@alloy

alloy May 23, 2012

Member

Yes, this will definitely have to be fixed.

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

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin May 24, 2012

Member

Sorry I referenced the wrong issue :-(

Member

fabiopelosin commented May 24, 2012

Sorry I referenced the wrong issue :-(

@fabiopelosin

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Jun 6, 2012

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.

Member

fabiopelosin commented Jun 6, 2012

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

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Jun 6, 2012

Member

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

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

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Jul 12, 2012

Member

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

Member

alloy commented Jul 12, 2012

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

@fabiopelosin

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Jul 12, 2012

Member

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

Member

fabiopelosin commented Jul 12, 2012

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

fabiopelosin added a commit that referenced this issue Oct 25, 2014

@onmyway133

This comment has been minimized.

Show comment Hide comment
@onmyway133

onmyway133 Jun 29, 2015

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

@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