javascript - React native Android 给出关于 gradle 的错误

标签 javascript android react-native

enter image description here

我在 Android 中运行代码时遇到此错误,这是关于 gradle 但我已经在 build.gradle 中添加了这个东西

repositories {
        jcenter()
        google()

    }

请帮忙提前谢谢

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.+' // <- USE 2.2.+ version
    }
}

allprojects {
    repositories {
        // Add jitpack repository (added by tipsi-stripe)
        maven { url "https://jitpack.io" }
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

这是我的构建 gradle,它说第 13 行有问题

最佳答案

检查您的 gradle-wrapper.properties 文件并将 distributionUrl 更改为

distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

关于javascript - React native Android 给出关于 gradle 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53423911/

相关文章:

javascript - 避免克隆复制

java - Android 选项菜单不起作用?

react-native - 我如何在 react 原生中为 android 设置回上一个事件?

javascript - Chrome 控制台在所有 JS 文件中搜索一串文本?

javascript - 返回具有过滤结果的新 JSON 对象

javascript - 我该如何使用 $.get 来做到这一点?

Android, Realm , Gradle : Error:Annotation processor: RealmProcessor not found

android - IDEA 社区版和终极版有什么区别?

react-native - 如何在卡片上添加 onPress 事件(在 native 基础上)?

macos - React Native macOS 菜单栏应用程序可以吗?