app目录下的build.gradle文件

apply plugin: 'com.android.application'//表示这是一个应用  com.android.library表示这是一个库文件android {    compileSdkVersion 29    //sdk版本    buildToolsVersion "29.0.0"    //构建工具版本    defaultConfig {        applicationId "com.example.newtest"        //包名        minSdkVersion 21        //最低兼容的Android系统版本        targetSdkVersion 29        //为你的应用程序启用一些该版本的新新功能和特性,        versionCode 1        //版本号        versionName "1.0"        //版本名        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"        ndk {            //设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so)            abiFilters "armeabi","armeabi-v7a","arm64-v8a", "x86","x86_64"        }    }    //buildTyoes闭包用于指定生成安装文件的相关配置    buildTypes {        //relsease闭包指定生成安装文件的相关配置        //debug用于指定生成测试版安装文件的配置        release {            //minifyEnable用于指定是否对项目的代码进行混淆,true表示混淆,false表示不            minifyEnabled false            //proguard-android-optimize.txt 表示所有项目通用的混淆规则,proguard-rules.pro表示特有的混淆规则,至于当前项目的根目录下            //此处为空            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'        }        //注:通过android studio直接运行项目生成的都是测试版安装文件    }}//dependencise 闭包可以指定当前项目所有的依赖关系dependencies {    //本地依赖声明    implementation fileTree(dir: 'libs', include: ['*.jar'])    //远程依赖,自动在jcengter库中下载这个依赖,implementation用于项目中文件    implementation 'androidx.appcompat:appcompat:1.0.2'    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'    //testImplementation 声明测试用例库    // testImplementation用于test下文件    testImplementation 'junit:junit:4.12'    //  androidTestImplementation用于androidtest下文件    androidTestImplementation 'androidx.test:runner:1.2.0'    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'    implementation 'com.amap.api:3dmap:5.0.0'    implementation 'com.amap.api:location:3.3.0'    implementation 'com.amap.api:search:5.0.0'}

最外层目录下的build文件

//管理全局项目配置,通常不需要修改buildscript {    repositories {        google()        jcenter()        //jcenter是一个代码托管仓库    }    dependencies {        //声明一个Gradle插件        classpath 'com.android.tools.build:gradle:3.4.1'                // 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}

更多相关文章

  1. Android在配置文件中配置Button再不同情况下的的背景
  2. Android通过SOCKET下载文件的方法
  3. android历史版本
  4. 00_JNI头文件
  5. Android 之 使用Pull 解析xml文件
  6. android关于蓝牙不能传送APK文件
  7. Android布局文件-错误

随机推荐

  1. Android仿人人客户端(v5.7.1)——对从服务
  2. android中的事件传递和处理机制
  3. 【Android初学者】框架布局:仿微信页面制
  4. Android改变字体方法——Typeface
  5. Conversion to Dalvik format failed wit
  6. 如何在Ubuntu11.10(32位)下载Android4.0
  7. Android学习之界面篇(五)animateLayoutChan
  8. Unity与android互调用
  9. 在 Android(安卓)中使用 Java8 的特性!
  10. 谷歌加强Android监管,你的安卓机用起来会