2

I am unable to build my android app using react-native run-android, because I get following error. Yesterday everything worked fine. Do you know where could be the problem?

A problem occurred configuring root project 'contacto'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find builder.jar (com.android.tools.build:builder:3.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/builder/3.1.2/builder-3.1.2.jar
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
   > Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.1.2/manifest-merger-26.1.2.jar
   > Could not find builder-test-api.jar (com.android.tools.build:builder-test-api:3.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/builder-test-api/3.1.2/builder-test-api-3.1.2.jar
   > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.1.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.1.0/aapt2-proto-0.1.0.jar
   > Could not find builder-model.jar (com.android.tools.build:builder-model:3.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/builder-model/3.1.2/builder-model-3.1.2.jar
   > Could not find annotations.jar (com.android.tools:annotations:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/annotations/26.1.2/annotations-26.1.2.jar
David Novák
  • 1,455
  • 2
  • 18
  • 30
  • 1
    Possible duplicate of [Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0)](https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0) – zaplec May 28 '18 at 11:01
  • 2
    Yeah, seems like a problem with repository (server side) as stated in the duplicate question – Pl4yeR May 28 '18 at 11:05
  • Yup, the first answer on that post is correct for this error. – Izabela Orlowska May 29 '18 at 12:20
  • Maybe this will help: https://stackoverflow.com/a/52944600/4255978 – HedeH Oct 24 '18 at 19:17

3 Answers3

3

Add the following line in your project`s gradle file

allprojects {
    repositories {
        .....
        ......
        maven { url 'https://maven.google.com' }  //  Add this line.
        ......
    } }
samoz
  • 56,849
  • 55
  • 141
  • 195
Sachin Tyagi
  • 1,257
  • 15
  • 21
0

The only solution that worked for me was to go to Build --> Build Types, and add google() to both repos

Chop Labalagun
  • 592
  • 1
  • 6
  • 19
-2

For those who have the same error, try adding this to App Builde.gradle :

android {
    //the rest of the code above

    lintOptions {
       disable 'MissingTranslation'
    }
}

I had the same problem, and this, for whatever reason, worked for me.

Ayoub Laazazi
  • 540
  • 7
  • 15