I use ACRA 4.4.0 in my Android apps to receive crash reports from users. My IDE is ADT Build: v22.2.1-833290. Few days ago I've started using ProGuard for apps I'm going to publish on Google Play. When I install and start exported signed apk, a NoSuchFieldError occures for 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);
}
}
Including "-keep public class org.acra.*" in proguard-project.txt gives no effect. As I can see in GoogleDocs, the possible reason is that the Proguard does not work correctly with dynamically referenced fields and methods. Optimized APK(without ACRA) works good. Is there a way to fix this problem? Thanks in advance. Michael.