The ACRA documentation to integrate crash reporting consists of 3 simple steps:
2 - Add the following to the AndroidManifest.xml
<!-- in the manifest, not the application tag -->
<uses-permission android:name="android.permission.INTERNET" />
and
<application ... android:name=".MyApplication">
...
</application>
3 - Create a new java class with the same name as above 'MyApplication':
import org.acra.*;
import org.acra.annotation.*;
@ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath")
public class MyApplication extends Application {
@Override
public void onCreate() {
// The following line triggers the initialization of ACRA
super.onCreate();
ACRA.init(this);
}
}
That's supposed to be it. I think the instructions are a bit out of date and that the AndroidManifest.xml has evolved since then.
I also needed to add the following inside my <application> ... </application>
for it to function:
<service android:name="org.acra.sender.SenderService" />
Question: Am I doing something wrong or have Android requirements evolved and I'm doing it correctly?
Either way I also want to share/document my steps in case others have the same problems.
A more up-to-date basic setup instructions can be found on ACRA's GitHub Wiki: https://github.com/ACRA/acra/wiki/BasicSetup
Declaring the SenderService
ACRA (4.8+) uses the SenderService to send reports so it needs to be configured in your AndroidManifest.
If you are using manifest merging then the SenderService will be automatically included for you. Otherwise you will also need to configure a service that will send the reports. It should look like:
<service
android:name="org.acra.sender.SenderService"
android:exported="false"
android:process=":acra" />
NB the android:process ensures that the service runs in the :acra process. The intent is that that process is different from the default process for your application to ensure that the reports can be sent even though your app will be in shutdown mode if it has crashed.
It is likely that the documentation site has not been updated yet with the recent updates on the GitHub site.