How to link library manually? - react-native

I want to use react-native-youtube but it shows the error Native component for "RCTYouTube" does not exist, i try to find the solution it looks like i have to link the library manually if the library with native code.
But i have no idea with this link talk about Manual linking Step1 https://facebook.github.io/react-native/docs/linking-libraries-ios.html
I use type command create-react-native-app testyoutube to create my react native project, Visual Studio Code is my tool.
I'm not familiar with Xcode. I try to open my project folder testyoutube in Xcode. It will show an alert Could not open file.
If i want to follow Manual linking Step1 what step should i do ?
Here is my folder structure:
Any help would be appreciated. Thanks in advance.

To expand upon Adeel's answer:
Locate the RCTYouTube.xcodeproj at {your project root} /node_modules/react-native-youtube.
Use XCode to open your iOS project's .xcworkspace (or .xcodeproj if .xcworkspace does not exist).
Locate the 'Libraries' folder in the project navigator pane on the left hand side of the window and drag the RCTVideo.xcodeproj file inside it.
Select your project's target from the targets list pane on the inner left hand side of the window then scroll down to the 'Linked Libraries and Frameworks' section.
Click the plus symbol at the bottom of the section and use the search bar to find 'libRTCYouTube.a', select it from the results, and hit the 'Add' button.
Your library should now be linked!

You have two options to link libraries with your Xcode/Android project.
Automatic linking (run in your terminal in the root folder of your react-native project):
react-native link
Manual Setup:
It's actually very simple. Open your react native xcode project (.xcodeproject file) with Xcode.
On the left side you have the project navigator. Drag the Xcode project from react-native-youtube inside the Libraries group.
Project Navigator
Next step is to add the library to you project. Click on the left side on your xcode project in the project navigator. Go to the libraries section and add the RCTYoutube library.
After you have setup everything up, rebuild the project and you are good to go!

Related

Can't Add ReactNativeNavigation.xcodeproj to Libraries in Xcode

I can't add the ReactNativeNavigation.xcodeproj file to my projects Libraries. Any ideas on how to get around this? I left click on Libraries then click add files to my project then go into node_module → react-native-navigation → iOS but then I can't click on the Xcode.proj is like a disabled button when I click on it.
I'm using Xcode 9.4.1.
Screenshot:
Solution:
Some how (probably my doing) the ReactNativeNavigation was added to the main project folder so I dragged it down to where the Libraries folder was, and the problem was solved. I suggest if you have this issue to search all the folder in your project, because it is probably already added somewhere in the project.
I discovered ReactNativeNavigation was added to the main project folder so I dragged it down to where the Libraries folder was, and the problem was solved. I suggest if you have this issue to search all the folder in your project, because it is probably already added somewhere in the project.

How to add an app icon to a react-native project without using any npm packages or 3rd party libraries? Is it even possible to do so?

I am trying to add an app icon to a react-native application and am not able to do so also could hardly find anything about this in the documentation or any other sources which I am able to implement successfully.
Got this one working by using react-native-icon Package but is there Something like a single command to get icons configured into the respective folders when they are created using react-native eject command.
The app icons are controlled from the native side of the project.
You can set them up from Xcode or Android Studio fairly easily.
Perhaps take a look at Xcode 9 - Add an App Store icon and Set icon for Android application
use android asset studio
drag and drop your icon and change filters if you like and then download it.
Unzip it and then replace your res icon folder with this one
indepth tut tutorial

Exclude a package from react-native link

How do I link all packages except one using react-native link ?
I want to run it so that every package except react-native-vector-icons links and makes changes in the native files.
I'm not sure how to do this directly but you can, at least for IOS, open the Project's "Build Phases" tab and look in the "Link Binary with Libraries" dropdown, from which you can manually delete the undesired linked library. This won't delete any files, just the link.

How to link Cocoa Touch Static Library and Application Xcode 5 projects in the same workspace?

I've done the following steps:
Create an Xcode workspace
Right click the project navigator, choose new project, and add a Cocoa Static Touch Framework to the workspace
Right click the project navigator, choose new project, and add a Single View Application to the workspace
In the Single View Application's target, under Linked Frameworks and Libraries, add the libFrameworkName.a
In the Single View Application's Build Settings, add -ObjC to the Other Linker Flags
Now I'd like to go into the App Delegate of the Single View Application and #import "MyFramework" but it is not found.
What am I missing to Link the new Framework with the sample application?
I've obviously tried cleaning and building the project but that is not working. I think there must be some way to indicate that the Framework is a dependency of the Application but I'm not sure how.
In the build settings of the Sample Application search for "Search Paths". Add "../" as a recursive search path for User Header Search Paths.

Adding a Cocoa Touch Static Library as a subproject

How do I add a cocoa touch static library as a subproject to an application project in Xcode 4 (4.5 in this case)?
I have seen lots of screenshots that show a full project nested inside another project. However, whenever I follow the tutorials I just get a single .xcodeproj file inside my project, not a whole project (with it's own project and target etc).
I've tried to create a workspace too - but still no luck. What am I doing wrong? I've seen many questions on SO that seem to be similar but nothing that has helped me resolve this.
I had tried dragging in from Finder and it seemed to work for apps but not libs. #Eiko got it in the comments to another answer... It was because the project was open elsewhere at the time. If I goto File > Close Project (on the original library project in xcode) and then drag in from Finder it works.
Drag it from finder into the sidebar of xcode.
When doing it this way just now it worked for me.
and as #Eiko points out close the project if it is open elsewhere first, since it can only be opened once...