Gradle镜像、版本导致cordova Android bui

2020-11-19  本文已影响0人  waitSunflower

gradle国内镜像,https://maven.aliyun.com/mvn/guide

buildscript {
    repositories {
        // mavenCentral()
        // maven {
        //     url "https://maven.google.com"
        // }
        // jcenter()
        maven {
            url 'https://maven.aliyun.com/repository/central/'
        }
        maven {
            url 'https://maven.aliyun.com/repository/public/'
        }
        maven {
            url 'https://maven.aliyun.com/repository/google/'
        }
        mavenLocal()
        mavenCentral()
    }

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

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        // mavenCentral();
        // jcenter()
        maven {
            url 'https://maven.aliyun.com/repository/central/'
        }
        maven {
            url 'https://maven.aliyun.com/repository/public/'
        }
        maven {
            url 'https://maven.aliyun.com/repository/google/'
        }
        mavenLocal()
        mavenCentral()
    }
}

app cordovaLib project 三个build.gradle里面的资源库地址都要改

Gradle与Gradle插件版本对应关系
https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin

gradle-wrapper.properties这个文件修改Gradle版本
build.gradle这个文件里面修改gradle插件版本

上一篇下一篇

猜你喜欢

热点阅读