Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android react native-获取生成工具文件时出错_Android_React Native_Gradle - Fatal编程技术网

Android react native-获取生成工具文件时出错

Android react native-获取生成工具文件时出错,android,react-native,gradle,Android,React Native,Gradle,我无法使用react native run android构建我的android应用程序,因为我遇到以下错误。昨天一切顺利。你知道哪里有问题吗 A problem occurred configuring root project 'contacto'. > Could not resolve all files for configuration ':classpath'. > Could not find builder.jar (com.android.tools.bui

我无法使用
react native run android
构建我的android应用程序,因为我遇到以下错误。昨天一切顺利。你知道哪里有问题吗

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

在项目的gradle文件中添加以下行

allprojects {
    repositories {
        .....
        ......
        maven { url 'https://maven.google.com' }  //  Add this line.
        ......
    } }

对于有相同错误的用户,请尝试将此添加到App Builde.gradle:

android {
    //the rest of the code above

    lintOptions {
       disable 'MissingTranslation'
    }
}

我也遇到了同样的问题,无论出于什么原因,这对我来说都是有效的。

唯一对我有效的解决方案是去构建-->构建类型,并将google()添加到两个repo中

可能重复的Yeah,看起来像是重复问题Yup中所述的存储库(服务器端)的问题,这篇文章的第一个答案对于这个错误是正确的。也许这会有帮助: