【问题标题】:How user cloudant to send app crash report in android用户 cloudant 如何在 android 中发送应用程序崩溃报告
【发布时间】:2013-08-02 09:38:03
【问题描述】:

我正在使用ACRA 发送我的应用程序的崩溃报告。我想使用 Cloudant 的免费托管服务。

我在 cloudant 名称“mobile”上创建了一个数据库,并为它生成了具有写入权限 using it 的密钥。

我在我的应用和构建路径中添加了 acra-4.5 jar 文件。

formUriBasicAuthLogin 有密钥,formUriBasicAuthLogin 有密码。

我的应用程序类中的代码使用-

@ReportsCrashes(formKey = "",
formUri = "https://mshuiet.cloudant.com/mobile/",

 reportType = org.acra.sender.HttpSender.Type.JSON,

 httpMethod = org.acra.sender.HttpSender.Method.PUT,

 formUriBasicAuthLogin="Berndiverewyetheewrillyi",
 formUriBasicAuthPassword="vWqRNHUoc26SodsvtmNTWDcw",
 mode = ReportingInteractionMode.TOAST,
resToastText = R.string.app_name
)

 public class Mobile extends Application{

@Override
public void onCreate() {

    // TODO Auto-generated method stub
    super.onCreate();
     ACRA.init(this);
}

 }

我有异常:-

未能发送 1375431176000-approved.stacktrace 的崩溃报告

【问题讨论】:

  • 这是异常消息的全部内容吗?似乎悲惨地稀疏。

标签: android cloudant


【解决方案1】:

在 Cloudant 中,文档是通过 POST 创建的。对这样的 URL 的 PUT 试图创建一个名为“mobile”的新数据库,而 POST 试图在该数据库中创建一个文档。查看我们关于 databasedocument 方法的文档了解更多详情。

所以,具体来说,尝试更改这一行...

httpMethod = org.acra.sender.HttpSender.Method.PUT,

...到这个:

httpMethod = org.acra.sender.HttpSender.Method.POST,

【讨论】:

    【解决方案2】:

    此外,CloudAnt 数据库名称前面需要有“acra” 在您的情况下,根据此处的文档,它将是“acra-mobile”

    https://github.com/ACRA/acralyzer/wiki/setup

    另外,您的 URL 路径应如下所示(删除空格)

    https:// [my-user-id] 。浑浊。 com/ [我的数据库] / _design/ acra-storage/ _update/ 报告

    而且Http方法应该是这样的

    httpMethod = org.acra.sender.HttpSender.Method.POST

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-19
      • 1970-01-01
      • 1970-01-01
      • 2013-09-24
      • 2013-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多