2、安卓的编译配置文件

  • 项目级别的build.gradle指定了当前项目的总体编译规则
  • 模块级别build.gradle需要进行详细介绍
plugins {
    id 'com.android.application'
}

android {
    //指定编译用的SDK版本号
    compileSdk 34

    defaultConfig {
        // 指定该模块的应用编号,也就是APP的包名,也就是应用的身份证号码
        applicationId "com.example.myapplication"
        // APP最小适合运行的SDK版本号
        minSdk 28
        // 指定目标设备的SDK版本号,表示APP最希望在哪里运行
        targetSdk 34
        // APP的应用版本号(唯一表示)
        versionCode 1
        // 版本名称
        versionName "1.0"
        // 单元测试类
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    // 指定混淆规则文件
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

// 做好兼容性的解决方案,APP编译的依赖信息
dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值