Middle+
What would you do if the release build of your application crashes at a different place than the debug build?
sobes.tech AI
Answer from AI
I would check the differences in build configurations: R8/ProGuard, enabling/disabling debug information, compilation flags, dependencies (especially transitive ones). I would look at logs and stack traces from the release build. I would use performance monitoring and crash reporting tools (Crashlytics, Sentry). I would conduct A/B testing or phased rollout to identify the crash pattern.
// Example R8 rules configuration
-keep class com.example.MyClass {
*;
}
// Example of adding logcat in release (usually enabled for debug builds)
BuildConfig.DEBUG || Log.d("TAG", "Log message");
I would compare the library versions used in both builds. I would recheck the implementation of features that might behave differently in optimized and non-optimized builds, such as multithreading or memory management. The issue might be related to ProGuard rules that removed necessary code.