使用电子邮件进行Acra报告 [英] Acra reporting using email

查看:274
本文介绍了使用电子邮件进行Acra报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ACRA报告我的应用程序中未处理的异常。

I am trying to use ACRA to report unhandled exceptions in my app.

获得许可:

<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:name=".MyApplication">

等级:

compile 'ch.acra:acra:4.9.0'

扩展的应用程序类

package online.hannuveda.transafe_rx;

import org.acra.*;
import org.acra.annotation.*;
import android.support.multidex.MultiDexApplication;


@ReportsCrashes(formUri = "",
        mailTo = "akshaycjoshi@gmail.com",
        mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.crash_toast_text)

public class MyApplication extends MultiDexApplication
{
    @Override
    public void onCreate() {
        super.onCreate();
        ACRA.init(this);
    }
}

在我的登录按钮中,我故意创建了一个例外使用此命令:

In my login button, I am deliberately creating an exception using this:

public void Login_Click(View v)
{

    int i = 12/0;
}

发生此异常时,我看到烤面包,然后应用崩溃了,但是我在我的收件箱中看不到任何电子邮件。知道有什么问题吗?

When this exception occurs, I see the toast, then the app crashes but I don't see any email in my inbox. Any idea what is wrong ?

推荐答案

删除 formUri = ,然后重试。

如果同时传递了 formUri mailTo ,它将首先尝试通过HTTP将其发送到端点 并使用 mailTo 作为后备如果没有Internet权限,但是您确实具有此权限,因此它只会尝试将其发送到 ,而不会尝试发送邮件。

If you pass both formUri and mailTo, it will first try to send it via HTTP to the endpoint "" and use the mailTo as fallback in case there is no internet permission, but you do have the permission so it only tries to send it to "", and won't try to mail it.

这篇关于使用电子邮件进行Acra报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆