Could not find media-1.0.0.jar (androidx.media:media:1.0.0)

Viewed 349

I wanna use react-native-video in my project, but when I start compiling, I get this error: "Could not find media-1.0.0.jar (androidx.media:media:1.0.0)". My build.gradle file:

buildscript {
    ext {
        buildToolsVersion = "30.0.1"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:3.6.2')
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.android.tools.build:gradle:3.4.1'
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

How can I fix it? "implementation 'androidx.media:media:1.0.0'" doesn't help.

2 Answers

add implementation "androidx.media:media:1.2.1" into your app\build.gradle file in dependencies. Mine solved by that I hope it work out for you too.

Try to add the implementation "androidx.media:media:1.2.1" in dependencies of

node_modules\react-native-video\android\build.gradle

and:

node_modules\react-native-video\android-exoplayer\build.gradle

This worked for me with version 5.1.1 of this lib

Related