0
0
Android Kotlinmobile~20 mins

Build variants (debug, release) in Android Kotlin - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Build Variant Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding build variant purpose
What is the main purpose of having separate debug and release build variants in Android development?
ATo allow developers to test the app with debugging tools and enable optimizations for the final release.
BTo create two completely different apps with unrelated codebases.
CTo prevent the app from running on certain devices.
DTo automatically translate the app into multiple languages.
Attempts:
2 left
💡 Hint
Think about why developers need different versions during development and for users.
ui_behavior
intermediate
1:30remaining
Behavior difference in debug vs release
If you add a log statement inside your Android app, in which build variant will the log messages typically appear?
AOnly in the debug build variant.
BOnly in the release build variant.
CIn both debug and release build variants.
DLog statements never appear in any build variant.
Attempts:
2 left
💡 Hint
Consider what happens to logs in release builds for performance and security.
lifecycle
advanced
2:00remaining
Build variant effect on app signing
Which statement correctly describes how app signing differs between debug and release build variants in Android?
ANeither debug nor release builds require signing.
BBoth debug and release builds use the same keystore automatically generated by Android Studio.
CRelease builds do not require signing, but debug builds do.
DDebug builds use a debug keystore automatically generated by Android Studio; release builds require a developer-provided keystore.
Attempts:
2 left
💡 Hint
Think about how apps are prepared for publishing versus testing.
📝 Syntax
advanced
2:00remaining
Gradle build variant configuration
Given this snippet in build.gradle.kts, which option correctly adds a custom field only to the debug build?
Android Kotlin
android {
  buildTypes {
    getByName("debug") {
      // Add custom field here
    }
  }
}
AbuildConfigField(String, API_URL, 'https://debug.api.com')
BbuildConfigField("String", "API_URL", "https://debug.api.com")
CbuildConfigField("String", "API_URL", "\"https://debug.api.com\"")
DbuildConfigField('String', 'API_URL', 'https://debug.api.com')
Attempts:
2 left
💡 Hint
Remember the syntax requires types and values as strings with escaped quotes.
🔧 Debug
expert
2:30remaining
Release build crashes due to missing debug-only code
You have code that calls a debug-only method inside your app. It works in debug builds but crashes in release builds. What is the most likely cause?
ARelease builds do not support method calls at all.
BThe debug-only method is removed or not included in the release build, causing a crash.
CThe debug build disables ProGuard, so the method is missing in debug builds.
DThe release build uses a different programming language.
Attempts:
2 left
💡 Hint
Think about code shrinking and conditional compilation in release builds.