1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > gradle 编译java配置文件_Andriod(三):配置文件build.gradle与AndroidManifest.xml

gradle 编译java配置文件_Andriod(三):配置文件build.gradle与AndroidManifest.xml

时间:2024-08-01 16:37:36

相关推荐

gradle 编译java配置文件_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'

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。