0
点赞
收藏
分享

微信扫一扫

Android默认gradle配置

路西法阁下 2022-02-07 阅读 90

sss

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdk 30

    defaultConfig {
        applicationId "com.cmri.myapplication"
        minSdk 21
        targetSdk 30
        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
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    //协程
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'

    //ktx
    //fragment支持lifecycleScope等特性
    implementation "androidx.fragment:fragment-ktx:1.3.6"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-rc01"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-rc01"
}
举报

相关推荐

0 条评论