ACRA working on emulator but not in real device

284 views Asked by At

I have implemented ACRA on my Android application following this and this tutorials. I have achieved to send a mail to my mail account on my tests on the emulator that Android Studio use (in this case, a Pixel 3 with Android 10):

enter image description here

But, when I generate APK of this project and try to launch it on my device, it shows the TOAST message (saying that the application has failed and that is going to be sent a mail), but, when my default mail application is opened, the mail is completely empty (with no subject and no body). I don't know what could be happening, maybe some permissions issue?

I also use gmail as my default mail application in my device (Xiaomi Red Mi Note 4 with Android 9).

The permissions included in my Android manifest file (The first two are necessary for other things that the application do):

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

My class Application to handle the Application context:

import android.app.Application;
import org.acra.*;
import org.acra.annotation.*;

@ReportsCrashes(
        mailTo = "[email protected]",
        mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.crash)
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ACRA.init(this);
    }
}

This class has been added in Android Manifest file:

android:name=".MyApplication"

I'm using ACRA version 4.9.0, and in my build.gradle file I have included this deppendecy:

implementation 'ch.acra:acra:4.9.0'

My Compile SDK version is 28 and I'm using Java 1.8.

Thanks in advance.

0

There are 0 answers