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

Problem in a project with two targets, generating a framework for iOS and Apple TV #4928

Closed
talesp opened this Issue Feb 23, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@talesp

talesp commented Feb 23, 2016

I'm trying to create a project with two targets, one generating a framework for iOS and the other generating a framework for Apple TV.

Here is the Podfile:

workspace "CSGitHub.xcworkspace"
project "Shared/Shared.xcodeproj"

def shared_pods
    pod "Freddy", "~> 2.0.2"
    pod "Moya/RxSwift"
    pod "Nuke"
end

abstract_target "Shared" do

    use_frameworks!
    inhibit_all_warnings!

    target "SharediOS" do
        platform :ios, '9.0'

        shared_pods
    end

    target "SharedTV" do
        platform :tvos, '9.2'

        shared_pods
    end

end

If I run pod install like this, it will generate targets like this

captura de tela 2016-02-23 00 55 34

If I try to compile like this, I get this error:

ld: warning: directory not found for option '-F/Users/talesp/Library/Developer/Xcode/DerivedData/CSGitHub-chhyzynmakhwybfurbidfrwoahko/Build/Products/Debug-iphonesimulator/Pods-SharediOS'
ld: framework not found Alamofire
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to comment one of the targets inside the abstract_target block, and everything went OK, and the targets inside the Pods project looked like this:

captura de tela 2016-02-23 00 57 23

Searching though the project settings, I found that, besides the fact that when both targets are active it adds the prefix Pod-MyTargetName- (for example, Pods-SharediOS-Alamofire) to the name of the shared framework, the inherit setting in my project/target still references the original framework name (in this case, Alamofire.

So, I think when there are multiple targets generating frameworks for two different platforms, the parameter OTHER_LDFLAGS in the *.xcconfig files inside Pods/Target Support Files/Pod-MyTarget should reflect the correct framework name.

Here is a link for a sample project https://www.dropbox.com/s/d8en5ln5zao39o1/CSGitHub.zip?dl=0

@segiddins

This comment has been minimized.

Show comment
Hide comment
@segiddins

segiddins Feb 23, 2016

Member

This might be fixed in @mrackwitz 's open PR

Member

segiddins commented Feb 23, 2016

This might be fixed in @mrackwitz 's open PR

@talesp

This comment has been minimized.

Show comment
Hide comment
@talesp

talesp Feb 23, 2016

Cool, do you have any plan to release a new beta including this PR?

talesp commented Feb 23, 2016

Cool, do you have any plan to release a new beta including this PR?

@fguchelaar

This comment has been minimized.

Show comment
Hide comment
@fguchelaar

fguchelaar Feb 25, 2016

This seems like a duplicate to #4920 and #4926, which are both resolved in 1.0.0.beta.4.

fguchelaar commented Feb 25, 2016

This seems like a duplicate to #4920 and #4926, which are both resolved in 1.0.0.beta.4.

@mrackwitz

This comment has been minimized.

Show comment
Hide comment
@mrackwitz

mrackwitz Feb 26, 2016

Member

Yes, the latest prerelease contains a fix for this issue.

Member

mrackwitz commented Feb 26, 2016

Yes, the latest prerelease contains a fix for this issue.

@mrackwitz mrackwitz closed this Feb 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment