Android Stdio换源以及配置项目
生活随笔
收集整理的這篇文章主要介紹了
Android Stdio换源以及配置项目
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
文章目錄
- 換阿里源
- 方法二(待測(cè))
- 換源
換阿里源
在C:\Users\Administrator\.gradle下創(chuàng)建init.gradle文件
方法二(待測(cè))
換源
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {repositories {google()jcenter()maven { url 'https://jitpack.io' }}dependencies {classpath "com.android.tools.build:gradle:4.0.1"classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'// 資源混淆插件:https://github.com/shwenzhang/AndResGuardclasspath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.17'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files} }allprojects {repositories {google()jcenter()maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/central/' }maven { url 'https://dl.bintray.com/getactivity/maven/' }maven { url 'https://dl.bintray.com/umsdk/release' }maven { url 'https://maven.google.com' }maven { url 'https://jitpack.io' }} }task clean(type: Delete) {delete rootProject.buildDir }config.gradle
// 通用配置 android {compileSdkVersion 31defaultConfig {minSdkVersion 16targetSdkVersion 31versionName '1.0'versionCode 10}// 支持 Java JDK 8compileOptions {targetCompatibility JavaVersion.VERSION_1_8sourceCompatibility JavaVersion.VERSION_1_8}// 設(shè)置存放 so 文件的目錄sourceSets {main {jniLibs.srcDirs = ['libs']}} }dependencies {// 依賴 libs 目錄下所有 jar 包implementation fileTree(include: ['*.jar'], dir: 'libs')// 依賴 libs 目錄下所有 aar 包implementation fileTree(include: ['*.aar'], dir: 'libs')// 谷歌兼容庫(kù):https://developer.android.google.cn/jetpack/androidx/releases/appcompat?hl=zh-cnimplementation 'androidx.appcompat:appcompat:1.3.0-alpha01'implementation 'com.google.android.material:material:1.3.0-alpha01' }參考文章:
https://www.cnblogs.com/qianmaoliugou/p/12369654.html
總結(jié)
以上是生活随笔為你收集整理的Android Stdio换源以及配置项目的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: nginx http请求强转https
- 下一篇: Android Stdio 添加jar或