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

React Native link adds tvOS library targets to the ios target #13783

Closed
cmcewen opened this issue May 4, 2017 · 21 comments
Closed

React Native link adds tvOS library targets to the ios target #13783

cmcewen opened this issue May 4, 2017 · 21 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@cmcewen
Copy link
Contributor

cmcewen commented May 4, 2017

Description

In adding a tvOS target to the react-native-vector-icons library, react-native link inadvertently adds the tvOS target to the normal ios target causing the app to fail to run

Reproduction Steps and Sample Code

Described here: oblador/react-native-vector-icons#461

Solution

React Native link needs to properly link the ios and tvOS library targets with the right target

Additional Information

  • React Native version: 0.44
  • Platform: iOS
  • Development Operating System: MacOS
  • Dev tools: XCode 8.3.2
@ericvicenti
Copy link
Contributor

Ah, bummer. react-native link can sometimes be clumsy, cc @grabbou who knows more about it

@oblador
Copy link
Contributor

oblador commented May 4, 2017

Also perhaps @Kureev?

@engmsaleh
Copy link

engmsaleh commented May 4, 2017

I have the same problem, I had to remove -lRNVectorIcons-tvOS manually from Xcode, in order to make it work.

@grabbou
Copy link
Contributor

grabbou commented May 8, 2017

The issue is in this code https://github.com/facebook/react-native/blob/master/local-cli/link/ios/registerNativeModule.js#L36-L40

It calls getProducts that returns an array of all products (the array will typically have two items tvOS and iOS targets) and adds them to getFirstTarget().

We need to handle those things in a way that we link tvOS with tvOS and iOS with iOS (and other targets in the future as well).

I'll be looking into that later this week - if anyone wants to start earlier, you can hit me up on slack.callstack.io and will be happy to help.

@grabbou
Copy link
Contributor

grabbou commented Jun 28, 2017

I am starting work on this issue and hopefully a nice solution lands soon :)

@grabbou
Copy link
Contributor

grabbou commented Aug 22, 2017

FYI: I have been working on this for past two weeks from time to time - the issue turned out to be quite complex and requires few changes to link and unlink philosophy. I keep posting updates here.

@srameshr
Copy link

Im stuck with this. ANy help?

@YasirSherzad
Copy link

Hi, do we need to have tvOS? How do we remove it from the project?

@douglowder
Copy link
Contributor

@grabbou any update on this? Is there anything I can do to help?

@grabbou
Copy link
Contributor

grabbou commented Nov 21, 2017

Yeah! Would love to pair and brainstorm few ideas out - do you think we could follow up on Slack and get this done? It's going to be a big rewrite of internals but it's quite needed.

douglowder referenced this issue in douglowder/react-native Nov 22, 2017
@matthargett
Copy link
Contributor

@dlowder-salesforce were you still planning to extract tvOS to be hosted out of tree?

@douglowder
Copy link
Contributor

@matthargett extracting tvOS is something that can hopefully be done eventually, but will take some time. For now, I'm just planning to fix the tvOS-specific issues, and work with @grabbou on cleaning up the CLI internals.

@TheoGit
Copy link

TheoGit commented Dec 20, 2017

@dlowder-salesforce what as a user do I need to do to get this fix? (great Chain React video btw)

@kitdesai
Copy link

@TheoGit this worked for me: react-native-device-info/react-native-device-info#258 (comment)

replace libRNDeviceInfo-tvOS.a with whatever lib is causing your build to fail

@TheoGit
Copy link

TheoGit commented Dec 20, 2017

@AnkitDesai I just got it to work - thanks! @dlowder-salesforce I have the simulator running now and look forward to having created an Apple TV App with React Native

@douglowder
Copy link
Contributor

@TheoGit thanks for the kind words.... to get my fix directly you can use

"react-native": "https://github.com/dlowder-salesforce/react-native#tvos-cli-link-fix-2",

in your package.json, or you can wait for this branch to get merged to a release version.

@TheoGit
Copy link

TheoGit commented Dec 21, 2017

@dlowder-salesforce thanks! I'm working on a big project and will visiting often - I also saw the rn-tvos-example-2048 project if you think that will help

@egid
Copy link

egid commented Jan 11, 2018

@dlowder-salesforce any idea when this branch will merge?

@douglowder
Copy link
Contributor

@grabbou will be reviewing the PR for this shortly.

Plo4ox pushed a commit to Plo4ox/react-native that referenced this issue Feb 17, 2018
…#13783)

Summary:
Fix issues with the react-native CLI when linking iOS and tvOS libraries to a project created with `react-native init`. (facebook#13783)

Verified the changes against test project at https://github.com/dlowder-salesforce/react-native-link-test.  Both `react-native link react-native-svg` and `react-native unlink react-native-svg` work correctly on this project.  Added new unit test for the new file added to `local-cli/link/ios`.

[CLI] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
[IOS] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
Closes facebook#17231

Differential Revision: D6837567

Pulled By: hramos

fbshipit-source-id: 234d3d3966ae1b89cd16a37c95d303553f7ba5f5
@kapilgorve
Copy link

To everyone else who is lading here and doesn't see answer on how to solve this.

You can manually delete library-tvOS.a in Xcode -> [Your iOS build target] -> Build Phrases -> Link Binary with Libraries.

@grabbou
Copy link
Contributor

grabbou commented Feb 5, 2019 via email

@facebook facebook locked as resolved and limited conversation to collaborators Dec 11, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests