反应本机-提取构建工具文件时出错 [英] react native - error while fetching build tools files

查看:59
本文介绍了反应本机-提取构建工具文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用react-native run-android构建我的Android应用,因为出现以下错误.昨天一切正常.你知道哪里可能出问题吗?

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

推荐答案

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

Add the following line in your project`s gradle file

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

这篇关于反应本机-提取构建工具文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆