I use ACRA 4.4.0 in my Android applications to receive crash reports from users. My IDE is ADT Build: v22.2.1-833290. A few days ago, I started using ProGuard for applications that I am going to publish on Google Play. When I install and run the exported signed apk, NoSuchFieldError occurs for the fields used in ACRA reports. My code is:
@ReportsCrashes(formKey = <my_key>, mailTo = <my_email>, customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT }, mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text) public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); ACRA.init(this); } }
The inclusion of "-keep public class org.acra. *" In proguard-project.txt has no effect. As I see in GoogleDocs, a possible reason is that Proguard is not working correctly using fields and methods with dynamic binding. Optimized APK (without ACRA) works well. Is there any way to solve this problem? Thanks in advance. Michael.
android acra proguard
Darkmike
source share