Andriod(三):配置文件build.gradle与AndroidManifest.xml

一、编译配置文件build.gradle

一般只需关注模块级别的即可。

apply plugin: 'com.android.application'

android {
    //指定编译用的SDK版本号。如28代表使用的是Android9.0编译
    compileSdkVersion 28
    //指定工具版本号,这里头两个数字必须与compileSdkVersion保持一致可以去SDK\build-tools找到
    //buildToolVersion"28.0.3"
    defaultConfig {
        //指定该模块的应用编号,即APP的包名。该参数为自动生成无需修改
        applicationId "com.example.myapplication"
        //指定APP适合运行的最小SDK版本号
        minSdkVersion 15
        //指定目标设备的SDK版本号
        targetSdkVersion 28
        //指定APP的应用版本号
        versionCode 1
        //指定应用版本的名称
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            //指定是否开启代码混淆功能。true表示开启
            minifyEnabled false
            //指定代码混淆规则文件的文件名
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
//指定APP编译的依赖信息
dependencies {
    //指定引用java包的路径
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    //指定单元测试编译用的Junit版本号
    testImplementation 'junit:junit:4.12'
    //指定编译Android的高版本支持库
    //implementation"com.android.support:appcompat-v7:28.0.0"
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值