Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not resolve all dependencies for configuration ':react-native-video:_debugPublishCopy' #1079

Closed
rahul-mutyalkar opened this issue Jun 21, 2018 · 14 comments

Comments

@rahul-mutyalkar
Copy link

Current behavior

Describe what happens when you encounter this issue.
I installed the plugin and linked it too.
but when i run the command react-native run-android
i get this error

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-video'.
> Could not resolve all dependencies for configuration ':react-native-video:_debugPublishCopy'.
> Could not find com.android.support:support-annotations:27.0.0.
Searched in the following locations:
file:/home/rahul/Desktop/androidSetting/extras/android/m2repository/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.pom
file:/home/rahul/Desktop/androidSetting/extras/android/m2repository/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.jar
file:/home/rahul/Desktop/androidApp/research/video_streaming_app/android/sdk-manager/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.jar
Required by:
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:extension-okhttp:2.7.3
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-core:2.7.3
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-dash:2.7.3
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-hls:2.7.3
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-smoothstreaming:2.7.3
video_streaming_app:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-ui:2.7.3

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 46.139 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Reproduction steps

A 1, 2, 3, etc. list of what's needed to see the issue happen.

Expected behavior

it should run without any problem

Platform

Which player are you experiencing the problem on:

  • iOS
  • Android ExoPlayer
  • Android MediaPlayer
  • Windows UWP
  • Windows WPF

Video sample

If possible, include a link to the video that has the problem that can be streamed or downloaded from.

@Lizhooh
Copy link

Lizhooh commented Jun 21, 2018

me too.

@cobarx
Copy link
Contributor

cobarx commented Jun 21, 2018

Looks like this is related to inheriting the SDK versions from #999. It's causing it to look for the SDK 27 support libraries.

Is it possible to attach the build.gradle from your app (app/build.gradle)? It is supposed to use the versions of the SDK and support libraries you already have, and I want to check if the issue is configuration dependent.

I'll do my best to get this sorted out today.

@cobarx
Copy link
Contributor

cobarx commented Jun 21, 2018

Ok, issue is that the inheritance didn't work the way I expect. You have to define the variables in a separate file rather than automatically figuring it out using the app/build.gradle. Looks like I will need to revert this PR. Checking to see if there is some way to get this to work real quick.

@cobarx
Copy link
Contributor

cobarx commented Jun 21, 2018

I've gone ahead and reverted the change and released 2.3.1. Basically what's happened is that I merged a PR that uses SDK 27 to build react-native-video and if you don't have the version 27 SDK installed the build fails.

I think upgrading to 27 is the right choice in the long run since Android is going to require people to be on SDK 26 or higher after October 2018. Facebook is already moving in this direction (facebook/react-native#18095). However, we can put this in a 3.0 release and document needing to install SDK 27 and how to stay on your existing SDK version if you're not happy with that.

Sorry for the inconvenience everyone.

@cobarx cobarx closed this as completed Jun 22, 2018
@edgargrs
Copy link

put maven { url "https://maven.google.com" }
in your /android/build.gradle
or
Reinstall Android Support Repository from Android Studio

@cobarx
Copy link
Contributor

cobarx commented Jun 27, 2018

@blok-0 Thanks for pointing that out. I'll see about adding that to the docs.

@edgargrs
Copy link

@cobarx Thanks!
Could not find com.android.support:support-annotations:27.0.0. -> is the problem
This post help me

@mmsmsy
Copy link

mmsmsy commented Jul 10, 2018

I followed all steps, but inevitably I'm still getting:

File C:\Users\Mateusz\.android\repositories.cfg could not be loaded.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-video'.
      > Could not resolve all dependencies for configuration ':react-native-video:_debugPublishCopy'.
         > Could not find com.android.support:support-annotations:27.0.0.
           Searched in the following locations:
               file:/C:/Users/Mateusz/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.pom
               file:/C:/Users/Mateusz/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.jar
               file:/C:/Projects/react-native-starter-master/android/sdk-manager/com/android/support/support-annotations/27.0.0/support-annotations-27.0.0.jar
           Required by:
               Starter:react-native-video:unspecified > com.google.android.exoplayer:extension-okhttp:2.7.3
               Starter:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-core:2.7.3
               Starter:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-dash:2.7.3
               Starter:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-hls:2.7.3
               Starter:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-smoothstreaming:2.7.3
               Starter:react-native-video:unspecified > com.google.android.exoplayer:exoplayer:2.7.3 > com.google.android.exoplayer:exoplayer-ui:2.7.3

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 12.725 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Any suggestions?

[edit with solution]
I found the issue. Since I know nothing about Android Dev I was incorrectly adding another maven entry in android/build.gradle. Here's what I did wrong:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
            url 'https://maven.google.com'
        }
    }
}

And here's how it should look with separate maven declaration:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

And now it works.

@jeithc
Copy link

jeithc commented Jul 28, 2018

thanks @mmsmsy your solution its fine for me

@ozankonur
Copy link

ozankonur commented Dec 9, 2018

Hi, I am trying like above but still getting this error:

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.google.android.exoplayer:exoplayer-core:2.9.1.

Here is my android build.gradle code:

allprojects { repositories { mavenLocal() google() jcenter() maven { url "https://maven.google.com" } maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } } }
Any suggestion ?

@ziyoshams
Copy link

This issue is resurfacing now.

@ozankonur
Copy link

ozankonur commented Dec 13, 2018

@ziyoshams add below line to your build.gradle

maven { url "https://google.bintray.com/exoplayer" } <----- add this line

@reza-madani
Copy link

reza-madani commented May 20, 2019

I replaced node_modules->react-native-video ->android_exoplayer->build.gradle line 32 with this line:

implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
I hope this help you.

react-native 059.5
react-native-video 4.4.1

@adalbertopompolo
Copy link

The fix for me was to remove this 'dependency' at react-native.config.js:

dependencies: {
    'react-native-video': {
      platforms: {
        android: { sourceDir: '../node_modules/react-native-video/android-exoplayer' },
      },
    },
  },

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants