How to create a release android library package (aar) in Android Studio (not debug)

后端 未结 9 833
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 07:50

I have built my android library package (aar) and the result of build is created in \"..\\app\\build\\outputs\\aar\" folder. The file within this folder is called \"app-deb

9条回答
  •  孤城傲影
    2020-12-02 08:40

    1.add following script to your android{} tag in build.gradle to generate a release build:

    signingConfigs {
        testConfig{
            storeFile file("X:/XXXX/yourkeystore")
            storePassword "yourKeyPassword"
            keyAlias "yourAlias"
            keyPassword "yourAliasPassword"
        }
    }
    
    buildTypes{
        release {
            signingConfig  signingConfigs.testConfig
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    

    2.run command "gradle clean build" in you command line.

提交回复
热议问题