ACRA自体が奇妙な問題をクラッシュさ:図書館プロジェクトでACRAを使用できますか?
IllegalStateException: Cannot access ErrorReporter before ACRA#init
私は完璧に動作ACRA 4.3.0でアプリを持っています。私はライブラリ全体にアプリを変更したので、私は小さなバリエーションを作ることができます。マニフェストとこの新しいライブラリへのリンク以外は全く空白の新しいプロジェクトを作成しました。 AcraApplication.javaでこれを試してみる人は、 "resToastText = R.string.crash_toast_text"行を削除し、Acra.init(これ)の下に新しい行を追加する必要があります。
ACRA.getConfig().setResToastText(R.string.crash_toast_text);
プロジェクトは、罰金のビルドとデバッグに私はACRA.init(これを)確認しました。私の主なプログラムコードの前で、エラーが発生する前に実行されます。メインプログラムでは、我々はいくつかのカスタムデータを設定する時点で:
ACRA.getErrorReporter().putCustomData("Orientation", "L");
それはクラッシュの原因となる(またはより正確に、ACRA自体はエラーが発生)と全くACRAレポートが生成されません。
次に試してみるべきアイディアや見た目はどこですか? ACRAはライブラリと互換性がないかもしれません。もしそうであれば、別の方法でそれを取り出すことができますが、ライブラリの目的を捨てることができます。
ソリューション:
ACRAConfiguration config = ACRA.getNewDefaultConfig(this);
config.setResToastText(R.string.crash_toast_text);
ACRA.setConfig(config);
ACRA.init(this);
(注)こののみv4.3.0で動作し、以降:代わりにAcra.init(this);
以下の行を追加することのInit行する前にこれらの3行を追加します。
こんにちは動作します私のproguard.cfgでは、私はまだ私のリリースで "NoSuchFieldError:SILENT"を取得します。私はそれを理解することはできません – Arnaud