React Native FAILURE:构建失败,发生异常。无法解析':classpath'。找不到com.android.tools.build:gradle:3.0.1 [英] React Native FAILURE: Build failed with an exception. Could not resolve ':classpath'. Could not find com.android.tools.build:gradle:3.0.1

查看:104
本文介绍了React Native FAILURE:构建失败,发生异常。无法解析':classpath'。找不到com.android.tools.build:gradle:3.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入命令 react-native run-android时,它发生了:



失败:生成失败,出现异常。




  • 出了什么问题:
    配置根项目 AsomeProject时出现问题。


    无法解析配置:classpath的所有文件。
    找不到com.android.tools.build:gradle:3.0.1。
    在以下位置搜索:

    解决方案

    我遇到了同样的问题,我尝试了 Manoj Prabhakar的解决方案,但我修复了一个将 google()存储库放入项目级别 build.gradle

    $ b $的buildscript块中b

      buildscript {
    存储库{
    jcenter()
    google()
    }
    依赖项{
    classpath'com.android.tools.build:gradle:3.0.1'
    }
    }


    When I make the command "react-native run-android" then it happened:

    FAILURE: Build failed with an exception.

    screenshot:

    解决方案

    I had the same problem, I tried Manoj Prabhakar's solution but I fixed adding the google() repository to the buildscript block in the project level build.gradle

    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
        }
    }
    

    这篇关于React Native FAILURE:构建失败,发生异常。无法解析':classpath'。找不到com.android.tools.build:gradle:3.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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