build.gradle注释

 

apply plugin: 'com.android.application'

android {
    //指定编译用的SDK版本号。如28表示使用Android 9.0编译
    compileSdkVersion 28

    defaultConfig {
        //指定该模块的应用编号,即APP的包名  该参数自动生成,无须修改
        applicationId "com.example.administrator.helloworld"
        //指定App运行适合运行的最小SDK版本号  如15表示至少要Android 4.1 上运行
        minSdkVersion 15
        //指定目标设备的SDK版本号  即该App最希望在哪个版本的Android 上运行
        targetSdkVersion 29
        //指定App的应用版本号
        versionCode 1
        //指定App的应用版本名称
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            //指定是否开启代码混淆功能 true表示开启混淆,false表示无须混淆
            minifyEnabled false
            //指定代码混淆规则文件的文件名
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

//指定App编译的依赖信息
dependencies {
    //指定引用jar包的路径
    implementation fileTree(dir: 'libs', include: ['*.jar'])
	 //指定编译Android的高版本支持库  如AppCompatActivity必须指定编译appcompat-v7库 
    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'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}


implementation 'com.android.support:appcompat-v7:28.0.0必须要根据支持库的实际版本号,否则会报错

你可能感兴趣的:(Android)