在app下的build.gradle
apply plugin: 'com.android.application' //表示安卓应用程序 //主要用于配置app模块信息 android { //安卓配置信息 compileSdkVersion 28 //编译sdk的版本 defaultConfig { //默认配置信息 applicationId "com.example.administrator.myapplication6_27" //应用的id minSdkVersion 25 //最小版本 targetSdkVersion 28 versionCode 1 //当前应用版本号 versionName "1.0" //版本名 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { //build类型 release { minifyEnabled false //是否将代码混淆 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }//混淆文件在上面,混淆的规则 目录proguard-rules.pro } dependencies { //gradle依赖的jar包 implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' implementation 'com.android.support.constraint:constraint-layout:1.1.2' 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' }
工程下的gradle文件(不是.gradle文件)下的wrapper下的gradle-wrapper.properties
#Wed Jun 27 18:06:53 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip #gradle文件的jar包的路径
工程下的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. //配置整个工程的信息 buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
工程下的settings.graddle
include ':app' //表示但前包含的模块就是app,用于标识有多少个模块
扫描二维码关注公众号,回复:
1811746 查看本文章