欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

AS3.X Gradle构建中:No cached version available for offline mode解决

程序员文章站 2022-04-12 19:29:09
Gradle构建中:No cached version available for offline mode解决AS3.X之后的offine Mode(离线模式)从setting中移到了这里:如果构建慢的话,可以把build.gradle改成这个:// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositori...

Gradle构建中:No cached version available for offline mode解决

AS3.X之后的offine Mode(离线模式)从setting中移到了这里:
AS3.X Gradle构建中:No cached version available for offline mode解决
如果构建慢的话,可以把build.gradle改成这个:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenLocal()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
        mavenCentral()
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

mavenLocal()是使用本地Maven仓库,如果之前没有配置过Maven本地仓库可以不加,如果有的话,看看自己的maven环境变量是不是M2_maven(因为我之前配置的时候默认都是用Maven_HOME配置的)注意path里面也要改:
AS3.X Gradle构建中:No cached version available for offline mode解决

本文地址:https://blog.csdn.net/qq_41473522/article/details/107571001

相关标签: 笔记