Could not resolve all files for configuration ':app:debugCompileClasspath' in react native

Viewed 9624

I tried running react-native run-android after having set up React Native using react-native init as I hate expo. But, I am getting problem here as this:

Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:27.1.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar
> Could not find livedata-core.aar (android.arch.lifecycle:livedata-core:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0.aar
> Could not find viewmodel.aar (android.arch.lifecycle:viewmodel:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0.aar
> Could not find runtime.aar (android.arch.core:runtime:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/runtime/1.1.0/runtime-1.1.0.aar

Any idea on how to get this working? I tried every question possible, but none of them seems working!

3 Answers

In my case I had to do the following

  cordova plugin add cordova-android-support-gradle-release --fetch

Remove cordova-plugin-add-swift-support from my plugins

used the versions mentioned here https://cordova.apache.org/news/2017/11/10/plugins-release.html

to remove cordova-plugin-compat

and finally move to the top

    maven {
      url "https://maven.google.com"
    }

or

    google() 

In my case I was set gradle folder expect %user_profile%\.gradle in android studio project setting and also I forgot to set GRADLE_USER_HOME to custom gradle folder. Or you should set GRADLE_USER_HOME in Environment to custom folder or use default gradle folder that dose not need to GRADLE_USER_HOME

Related