8

I run react-native 0.57.1 app, then I got the following lines.

FAILURE: Build failed with an exception.
* What went wrong:
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
Lintang Wisesa
  • 619
  • 10
  • 14
  • Post your `build.gradle` – Saurabh Thorat Oct 24 '18 at 05:49
  • Same issue for my react native project. I am trying to run the project in Ubuntu which was worked fine in Windows – SaraVanaN Oct 24 '18 at 06:05
  • open that project on android studio and sync and try run – Prasanth S Oct 24 '18 at 06:14
  • All com.android.support libraries must use the exact same version. Check versions in your android Gradle files. This https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification will help u to get an idea about it. – PushpikaWan Oct 24 '18 at 06:15

3 Answers3

7

Below worked for me, Try to put google() as the first repo as below. Don't put it under jcenter() and mavenCentral() for your existing Android Studio projects. And Just move google() from bottom to top in allprojects > repositories in build.gradle of module.

Originally, here is the answer

shizhen
  • 12,251
  • 9
  • 52
  • 88
SaraVanaN
  • 319
  • 1
  • 12
0

Open your android application using the android studio. Then try to build it. It will give u a direct information which causes to fail. It will suggest you to fixes as well. Then try to run it through that.

Most probably version complicit is there. All com.android.support libraries must use the exact same version. Check versions in your android Gradle files. This All com.android.support libraries must use the exact same version specification will help u to get an idea about it.

PushpikaWan
  • 2,437
  • 3
  • 14
  • 23
0

I posted it on my Github, then I've just got the answer: https://github.com/facebook/react-native/issues/21916. Simply on android/build.gradle I move google() to the first element in the list. Thx everyone!

Lintang Wisesa
  • 619
  • 10
  • 14