I wanted to use the same codebase for Android and iOS. I am using 2 different YouTube Players - this one for iOS and rn-youtube-android for Android.
However, using both in the same RN project shows a warning every time while running the Android version - even though the code never runs into those lines.
The problem becomes even more of an issue when you make Release Builds of the project where the Application just doesn't work - closes on launch because of the Warning that there's no native implementation of this git.
I'd suggest that the warning be removed by doing the following:
Change "main" the package.json to YouTube
{
"name": "react-native-youtube",
"version": "0.7.2",
"description": "A <YouTube/> component for React Native.",
**"main": "YouTube", /* instead of YouTube.ios.js */**
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
And change the implementation of YouTube.android.js to not throw a warning.
This way both the gits can be in the same RN Project and not cause "Unfortunately the app has closed." errors in the release build apk.
I wanted to use that rn-youtube-android but getting started instructions are so unclear. If possible can you explain some with better instructions ? Thanks
"package.json" has been updated, thanks @savioseb !
@cjmling : are the instructions README.md more clear now ?
( you have to git clone the project in node_modules => add lines to settings.gradle => add lines build.gradle => add lines to MainApplication.java )
@savioseb can u close this?
@jujumoz why is it needed to clone the repo? shouldnt install it through npm be enough?