Android Studip Run 'app' as Release

To Run Release build in Android Studio, click on Build Variants (Left-lower corner), change to release build.

or Android Studio -> Build -> Select Build Variant...

Android Studio Build Variant

NOTE: You might want to set debuggable true to build.gradle (Module:app) to enable logcat logging.

NOTE: Sign build with release key.

android {
    // sign with release key
    signingConfigs {
        config {
            keyAlias '***'
            keyPassword '***'
            storeFile file('***.jks')
            storePassword '***'
        }
    }

    buildTypes {
        debug {
            // sign with release key
            signingConfig signingConfigs.config
        }
        release {
            // enable logcat logging
            debuggable = true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // sign with release key
            signingConfig signingConfigs.config
        }
    }
}

If you bump into the following error

05/16 16:26:05: Launching app
The APK file D:\android\Travelopy\app\build\outputs\apk\release\app-release.apk does not exist on disk.
Error while Installing APK

Make sure Android Studio -> Run -> Edit Configuraion

or at the top toolbar, on the left side on run (play) icon, which is app, click the drop down for Edit Configuraion

At Before launch section, add Gradle-aware make if doesn't already exist.

NOTE: When prompted for Select Gradle Task, leave it blank and click OK.

Android Studio Gradle Aware Make

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.