美文网首页
App打包流程

App打包流程

作者: ProZoom | 来源:发表于2019-03-29 11:21 被阅读0次

    apply plugin: 'com.android.application'

    def releaseTime() {
    return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
    }

    android {

    signingConfigs {
        release {
            keyAlias 'kmsCoreWise'
            keyPassword 'kmsCoreWise'
            storeFile file('C:/KeyStore/sign_jokey.jks')
            storePassword 'kmsCoreWise'
        }
    }
    
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.cw.localnfcreadidcard"
        minSdkVersion 15
        targetSdkVersion 22 //必须1
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
    
            //不显示log日志
            buildConfigField "boolean", "LOG_DEBUG", "false" //不显示log
    
            //打开混淆
            minifyEnabled false
            //打开资源压缩
            //shrinkResources true
    
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    
    
        }
    }
    
    //配置自定义打包名称
    applicationVariants.all { variant ->
        variant.outputs.all {
            // 输出apk名称为 U8_20181119V1.3_release.apk
            def fileName = "${"NFC读本地身份证" + "${releaseTime()}"+"_" + buildType.name}.apk"
            outputFileName = fileName
        }
    }
    

    }

    //必须2
    repositories {
    flatDir {
    dirs 'libs' // aar目录
    }
    }

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    ////必须3
    implementation(name: 'nfc-local-idcard-sdk-20190329', ext: 'aar')
    //implementation project(':localsfz')
    }

    相关文章

      网友评论

          本文标题:App打包流程

          本文链接:https://www.haomeiwen.com/subject/fotlbqtx.html