
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
package.json
{
"name": "Project",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.1",
"react-native": "0.57.7",
"react-native-deprecated-custom-components": "^0.1.2",
"react-native-material-design-searchbar": "^1.8.0",
"react-native-scrollable-tab-view": "^0.10.0",
"react-native-vector-icons": "^6.1.0",
"react-native-youtube": "^1.1.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.50.0",
"react-test-renderer": "16.6.1"
},
"jest": {
"preset": "react-native"
}
}
Can someone please help me resolve this on android
same issue any fixes? w
In your mainApplication, have you add the ReactNativeYouTube package ?
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;
and in the getPackages() method, add new ReactNativeYouTube()
In your mainApplication, have you add the ReactNativeYouTube package ?
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;and in the
getPackages()method, addnew ReactNativeYouTube()
Yea I already have those things
Any update on this issue? Nothing I've tried has worked so far. I can't seem to find libRCTYoutube.a, if that is related to this problem.
Did you fix the problem? I came back to this after a while and got an error saying compile' is obsolete and has been replaced with 'implementation' and 'api' for react-native-youtube and my app module. I changed all the "complie" in build.gradle files to implementation and built my project again it seemed to have fixed the problem but not sure if that is the actual solution.
guys can u fix this problem. I got same error.
Same here.
Facing the same issue any fix?
In your mainApplication, have you add the ReactNativeYouTube package ?
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;and in the
getPackages()method, addnew ReactNativeYouTube()
@SuperBesse this fix the issue for me, in my case using react-native link doesn't import the package to mainapplication.java, so this should do for anyone who have same issue like me
facing the same issue
I managed to fix that by:
react-native link react-native-youtubecd android && gradlew cleanreact-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res(if step 4 fails just create the missing folders manually, you will probably have to create the assets one)
change
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.facebook.react:react-native:+
to
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:+'
and remove
buildToolsVersion "23.0.1"
in node_modules/react-native-youtube/android/build.gradle
In your mainApplication, have you add the ReactNativeYouTube package ?
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;and in the
getPackages()method, addnew ReactNativeYouTube()
This work for me too.
I was trying to add react-native-youtube by creating react-native-creating-library, the new version of react-native i.e., 0.60.3, supports auto-linking, still getting ReactYoutube was not found.
@ParthChugh +1
In addition to adding those two lines mentioned above to MainApplication.java, I also had to add this to settings.gradle:
include ':react-native-youtube'
project(':react-native-youtube').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-youtube/android')
And this to the dependencies in build.gradle:
implementation project(':react-native-youtube')
@timraybould is this problematic with v2?
@davidohayon669 good question, I'm not sure. I'm on 1.1 given I'm on React Native 59.10.
@timraybould ok.. I hope this is all handled in the next version that will get out of beta soon
@SuperBesse IOS generated this Error

can you help me ?
i'm new in react-native...using expo-cli for it, got same issue here. Isn't this feature working on expo??
Same error. Any fixes???
i'm new in react-native...using expo-cli for it, got same issue here. Isn't this feature working on expo??
It wont work in expo as you have to link files with native modules you can eject your project or use react-native-youtube-iframe it supports expo
Most helpful comment
In your mainApplication, have you add the ReactNativeYouTube package ?
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;and in the
getPackages()method, addnew ReactNativeYouTube()