android 中buildToolsVersion和dependencies

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "com.example.meng.newmessage"
        minSdkVersion 8
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    //compile 'com.android.support:support-v4:18.+'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
}

 

android {
    compileSdkVersion 17
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "com.example.meng.newmessage"
        minSdkVersion 8
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:18.+'
}

 

Android Studio ,Gradle 配置主要分为两部分:项目级别的 build.gradle 和应用级别的 build.gradle。 1. 项目级别的 build.gradle 该文件位于项目根目录下,主要用于配置项目的构建属性、仓库地址等。 示例代码: ``` buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:4.2.2' } } allprojects { repositories { jcenter() google() } } ``` 其: - `buildscript` 用于配置项目构建所需要的依赖库,如 `com.android.tools.build:gradle`,以及仓库地址。 - `allprojects` 用于配置所有模块的仓库地址。 2. 应用级别的 build.gradle 该文件位于 app 模块目录下,主要用于配置应用的构建属性、依赖库等。 示例代码: ``` apply plugin: 'com.android.application' android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 21 targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'com.google.android.material:material:1.4.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } ``` 其: - `apply plugin: 'com.android.application'` 表示应用模块使用 Android 应用插件。 - `android` 用于配置应用的构建属性,如编译版本号、应用ID、依赖库等。 - `dependencies` 用于配置应用的依赖库,可以通过 Maven 仓库、本地目录或文件、远程仓库等方式引入。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值