chkm8
chkm8

Reputation: 1302

org.acra.CrashReportDialog not found

I found this wonderful library https://github.com/ACRA/acra for Crash Report Tracking. I have imported the jar file into my project and added the ACRA.init to my current application.

public class AppController extends Application {
.......
@Override
public void onCreate() {
    super.onCreate();
    mInstance = this;
    ACRA.init(this);
}

<application
        android:name="com.mobiledev.Synergy.control.AppController"
        android:label="@string/app_name">

And every time I run the app I get this error.

STACK_TRACE=android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mobiledev.Synergy/org.acra.CrashReportDialog}; have you declared this activity in your AndroidManifest.xml?

at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1556)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)
at android.app.ContextImpl.startActivity(ContextImpl.java:1054)
at android.app.ContextImpl.startActivity(ContextImpl.java:1043)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:283)
at org.acra.ErrorReporter.notifyDialog(ErrorReporter.java:757)
at org.acra.ErrorReporter$4.run(ErrorReporter.java:732)

I guess I need to include the CrashReportDialog Activity from the acra jar files. But how should I do it? Thanks guys,

Upvotes: 2

Views: 913

Answers (2)

SandTh
SandTh

Reputation: 2397

I just faced the exact same issue and resolved it like this:

  • go to the libs folder where the jar is located
  • try to delete the jar (with safe usage search)
  • (Android studio will ask confirmation whether you want to delete the entry in the:
 (workspaceroot)\(yourapppath)\build.gradle 

file

  • you want to replace the
compile files('libs/acra-4.(version).jar')

with

compile 'ch.acra:acra:4.7.0'
  • sync gradle (there is a link in the upper right corner of the gradle file your editing)
  • try to delete the jar again (required) (it should succeed now)
  • run your app and let the acra magic shine...

Regards,

S.

Upvotes: 0

Sam
Sam

Reputation: 4284

You need to add the following xml code in your manifest file

<activity android:name="org.acra.CrashReportDialog"
        android:theme="@android:style/Theme.Dialog"
        android:launchMode="singleInstance"
        android:excludeFromRecents="true"
        android:finishOnTaskLaunch="true" />

Upvotes: 2

Related Questions