Android - Could not find com.google.android.exoplayer:exoplayer:2.11.4.

See original GitHub issue

Hi, I am recently using this library in my RN project. It works fine in iOS devices, but when comes to android, I can’t build success. Here is the error log.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.google.android.exoplayer:exoplayer:2.11.4.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
       - file:/Users/teowenlong/.m2/repository/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
       - file:/Users/teowenlong/rn-visitor-app/node_modules/react-native/android/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
       - file:/Users/teowenlong/rn-visitor-app/node_modules/jsc-android/dist/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
       - https://dl.google.com/dl/android/maven2/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
       - https://www.jitpack.io/com/google/android/exoplayer/exoplayer/2.11.4/exoplayer-2.11.4.pom
     Required by:
         project :app
         project :app > project :react-native-video
   > Could not find com.google.android.exoplayer:extension-okhttp:2.11.4.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
       - file:/Users/teowenlong/.m2/repository/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
       - file:/Users/teowenlong/rn-visitor-app/node_modules/react-native/android/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
       - file:/Users/teowenlong/rn-visitor-app/node_modules/jsc-android/dist/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
       - https://dl.google.com/dl/android/maven2/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
       - https://www.jitpack.io/com/google/android/exoplayer/extension-okhttp/2.11.4/extension-okhttp-2.11.4.pom
     Required by:
         project :app > project :react-native-video

It keeps saying that exoplayer is not found. but I had follow exactly the installation steps stated in main page. What had I done wrongly?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

14reactions
stevehs17commented, Feb 20, 2022

Worked for me with RN 0.67.2.

I was able to fix this by adding the line jcenter() to android/build.gradle (rather than android/app/build.gradle). Here is the context:

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        // I ADDED THE NEXT LINE:
        jcenter() 
        maven { url 'https://www.jitpack.io' }
        maven {
            // expo-camera bundles a custom com.google.android:cameraview
            url "$rootDir/../node_modules/expo-camera/android/maven"
        }
    }
}

13reactions
JDMathewcommented, Mar 15, 2022

To prevent this from conflicting with marvenCentral it’s better to add the following to android/app/build.gradle under

allprojects { 
  repositories {
  
  // Add jcenter **********

  jcenter() {
            content {
                includeGroup("com.google.android.exoplayer")
            }
        }

  // **********
      
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find com.google.android.exoplayer ... - Stack Overflow
Exoplayer library version 2.4.2 isn't found on Google's Maven Repo anymore. Change the implementation to this
Read more >
Bug - Applovin ad module crashes. - Unity Forum
I am trying Unity Mediation, and added some ad modules under it. Among those ad modules, I have been facing issue in Applovin...
Read more >
Hello world! - ExoPlayer
An application level media player for Android.
Read more >
unable to load deps - React Native - Zoom Developer Forum
Could not find com.google.android.exoplayer:exoplayer-core:2.12.3. Searched in the following locations: - https://repo.maven.apache ...
Read more >
ExoPlayer in Android with Example - GeeksforGeeks
ExoPlayer is released in API level 16 and it will not work on the device below API ... import com.google.android.exoplayer2.trackselection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found