4

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!

JustABeginner
  • 785
  • 2
  • 11
  • 26

4 Answers4

5

This worked! Just move google() from bottom to top in allprojects > repositories in build.gradle of module. Reference -> https://stackoverflow.com/a/52950717/8237551

JustABeginner
  • 785
  • 2
  • 11
  • 26
  • @KyloRen, if you are using Android Gradle Plugin **below 3.0.0**, then should add `maven { url "https://maven.google.com" }` instead of `google()` – shizhen Oct 26 '18 at 01:50
  • No i was using google 3+. It was my own stupidity, I was doing everything and not saving it. I saved and set environment variable and it worked – Kylo Ren Oct 26 '18 at 08:43
0

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() 
Paola Reyes
  • 152
  • 2
  • 12
0

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

Vahid
  • 1,588
  • 4
  • 22
  • 34
0

Insure U have a proper internet connection and bandwidth. (+Probabley Proxy setting).

M. Diana
  • 11
  • 3