当前位置:   article > 正文

android studio设置国内镜像_android studio 镜像源

android studio 镜像源

1.android studio版本

Android Studio 4.1

Build #AI-201.8743.12.41.6858069, built on September 23, 2020

Runtime version: 1.8.0_242-release-1644-b01 amd64

2.设置腾讯的镜像库

\gradle\wrapper\gradle-wrapper.properties

distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-5.4.1-bin.zip

目的:通过腾讯镜像系在gradle

3.增加阿里云的镜像

02.build.gradle

buildscript {

    repositories {

//增加阿里云路径

        maven {

            url 'https://maven.aliyun.com/repository/google/'

        }

        maven {

            url 'https://maven.aliyun.com/repository/jcenter/'

        }

        google()

        jcenter()

    }

    dependencies {

        classpath 'com.android.tools.build:gradle:3.1.3'

        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

allprojects {

    repositories {

        maven {

            url 'https://maven.aliyun.com/repository/google/'

        }

        maven {

            url 'https://maven.aliyun.com/repository/jcenter/'

        }

        google()

        jcenter()

        mavenCentral()

    }

//为了解决Execution failed for task ':XXXX:mockableAndroidJar'.,没有问题可以不加

    gradle.taskGraph.whenReady {

        tasks.each { task ->

            if (task.name == 'mockableAndroidJar') {

                task.enabled = false

            }

        }

    }

}

4.编译jar

在Terminal中运行gradlew makeJar

\Android\sdk\build-tools\30.0.2

然后d8 --output test.jar test.jar

  1. 出现问题:

cvc-complex-type.2.4.a: ��������Ԫ�� 'base-extension' ��ͷ����Ч���ݡ�Ӧ�� '{layoutlib}' ֮һ��ͷ��

修改classpath 'com.android.tools.build:gradle:3.5.2'

3.5.2应该是对应特定版本,需要检证

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/99597
推荐阅读
相关标签
  

闽ICP备14008679号