0
0
Android Kotlinmobile~10 mins

Build variants (debug, release) in Android Kotlin - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a debug build variant in the Gradle build script.

Android Kotlin
android {
    buildTypes {
        debug {
            isMinifyEnabled = [1]
        }
    }
}
Drag options to blanks, or click blank then click option'
A0
Btrue
Cnull
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting isMinifyEnabled to true in debug causes harder debugging.
Using null or 0 instead of a boolean value.
2fill in blank
medium

Complete the code to define a release build variant with code shrinking enabled.

Android Kotlin
android {
    buildTypes {
        release {
            isMinifyEnabled = [1]
        }
    }
}
Drag options to blanks, or click blank then click option'
Afalse
Btrue
Cnull
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting isMinifyEnabled to false in release reduces optimization.
Using null or 0 instead of a boolean value.
3fill in blank
hard

Fix the error in the release build variant to enable ProGuard rules.

Android Kotlin
android {
    buildTypes {
        release {
            proguardFiles(getDefaultProguardFile([1]), "proguard-rules.pro")
        }
    }
}
Drag options to blanks, or click blank then click option'
A"proguard-android-optimize.txt"
B"proguard-android.txt"
C"proguard-android-debug.txt"
D"proguard-android-release.txt"
Attempts:
3 left
💡 Hint
Common Mistakes
Using debug or non-optimized ProGuard files in release builds.
Missing quotes around the file name.
4fill in blank
hard

Fill both blanks to define a build variant with signing config and minification.

Android Kotlin
android {
    buildTypes {
        release {
            signingConfig = [1]
            isMinifyEnabled = [2]
        }
    }
}
Drag options to blanks, or click blank then click option'
AsigningConfigs.release
BsigningConfigs.debug
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using debug signing config for release builds.
Disabling minification in release builds.
5fill in blank
hard

Fill all three blanks to define a debug build variant with applicationIdSuffix and debuggable flag.

Android Kotlin
android {
    buildTypes {
        debug {
            applicationIdSuffix = [1]
            isDebuggable = [2]
            versionNameSuffix = [3]
        }
    }
}
Drag options to blanks, or click blank then click option'
A".debug"
Btrue
C"-DEBUG"
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for isDebuggable in debug builds.
Omitting suffixes for debug builds.