Closed GoogleCodeExporter closed 9 years ago
Original comment by kevin.gaudin
on 24 Sep 2012 at 10:11
Fixed in this snapshot:
https://oss.sonatype.org/content/repositories/snapshots/ch/acra/acra/4.3.1-SNAPS
HOT/acra-4.3.1-20120925.193215-1.jar
Please test it and confirm that it's working for you. I'll publish an updated
release then.
Thanks for reporting this.
Kevin
Original comment by kevin.gaudin
on 25 Sep 2012 at 7:37
Hi Kevin,
I have verified the fix: in autoaccept mode, the dialog is no longer shown.
However, this snapshot contains another change that is causing issues for me: I
used to wrap the call to ACRA.init() in a check for whether the app is
debuggable. When I do that, the latest snapshot throws state exceptions when I
try to get the ErrorReporter instance (if ACRA wasn't initialized).
So I switched to using sendReportsInDevMode=true, but this doesn't do what I
need, which is disable ACRA entirely (no error dialog). Would it be possible to
either return to relaxed checks, or add another flag, like disableAcraInDevMode?
Original comment by pa...@paour.com
on 26 Sep 2012 at 8:29
Could you please copy here the failing init code ?
Original comment by kevin.gaudin
on 4 Oct 2012 at 5:10
debuggable = ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) > 0);
if (!debuggable) {
ACRA.init(this);
} else {
Log.d(MyTrails.APPTAG, TAG + "onCreate debuggable: disabling ACRA");
}
super.onCreate();
instance = this;
ErrorReporter reporter = ErrorReporter.getInstance(); // causes an InvalidStateException because ACRA.init() hasn't been called
reporter.putCustomData("version", getString(R.string.version));
reporter.putCustomData("build", getString(R.string.revision));
Original comment by pa...@paour.com
on 4 Oct 2012 at 7:34
There's something strange...
I really did only modify the issue with the DIALOG showing in this snapshot.
ErrorReporter.getInstance() does not exist anymore in ACRA 4.3. You should be
using ACRA.getErrorReporter().
Then, it makes no sense trying to get the ErrorReporter if ACRA.init() has not
been called as it would return null. Your calls to putCustomData would crash.
Original comment by kevin.gaudin
on 11 Oct 2012 at 10:41
When I look at the method signature for ErrorReporter.getInstance() in the jar
for 4.3 (release) that I use in my shipping app (and I did verify it was 4.3.0
by looking at the maven manifest in the jar), it shows that it is still there,
but deprecated (and with a functional change).
I'll switch to using ACRA.getErrorReporter, but you may want to actually remove
that method, since the functional change causes an exception (so better to
catch the change at compile- rather than run-time).
Original comment by pa...@paour.com
on 12 Oct 2012 at 7:57
Actually, ACRA.getErrorReporter doesn't just return null when ACRA.init()
hasn't been called, it also throws an IllegalStateException...
Original comment by pa...@paour.com
on 12 Oct 2012 at 2:35
It does not return anything since it throws an exception.
I was just saying that if it did not throw an exception, then it could only
return null... and that would make your code crash anyway.
Though, I have to think about your idea of a disableAcraInDevMode.
Another option could be to do this:
ACRA.init(this);
if(debuggable) {
ACRA.getErrorReporter().setEnabled(false);
}
ErrorReporter.setEnabled() is the method which is called when a
SharedPreference change occurs to enable/disable ACRA. Dialogs are not
displayed if it is set to false.
Original comment by kevin.gaudin
on 13 Oct 2012 at 12:22
Good idea, I'll do that.
Original comment by pa...@paour.com
on 15 Oct 2012 at 8:28
Delivered in v4.3.1: https://github.com/downloads/ACRA/acra/acra-4.3.1.zip
Original comment by kevin.gaudin
on 16 Oct 2012 at 9:14
Original issue reported on code.google.com by
pa...@paour.com
on 24 Sep 2012 at 9:18