android - native react - 获取构建工具文件时出错

标签 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.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.
        ......
    } }

关于android - native react - 获取构建工具文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50563816/

相关文章:

android - Gradle with java 8 for retrolambda - Android 找不到注释 TargetApi

android - 找不到参数的方法 maven() [build_48jju0eu9q7aafln0yi713a7l$_run_closure1$_closure4@3cb5a1fe]

android - 进入android沉浸模式

动画 - 如何通过插值将动画值转换为实际值

java - Intellij思想: Issues with building project using IBM JDK 7

Gradle 多项目与 SCM

java - Android 编程和使用 HTML 解析器从 Wikia.com 页面提取类别数据以在 ListView 中使用

android - 具有Android模板匹配功能的OpenCV

android - 如何在设置 "Android/data/your_package/cache"后在 sdcard 上创建文件夹 "Clear data"?

javascript - 使用 React-Native 导航传递数据