我更改为最新的ACRA版本5.0.1。
如果我使用我自己的send方法,一切都运行得很好。
这是我的application.java中的一个片段:
@AcraCore(reportSenderFactoryClasses= AcraSenderfactory.class,reportFormat = StringFormat.KEY_VALUE_LIST)`enter code here`
public class FSApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
} 但是如果我尝试在HTTPSender中构建,我没有得到响应,但是这个发送者应该发送到同一个简单的php接收者。
我只是想让事情变得更简单,并使用httpSender中的构建。
但简单的方法是行不通的。
@AcraCore(reportFormat = StringFormat.KEY_VALUE_LIST)
@AcraHttpSender(uri = "http://my.server.de/acra/acra.php",
httpMethod = HttpSender.Method.POST)acra.php非常简单,但对于测试目的来说工作得很好。它只将包含所有值的文件写入服务器。
<?php
// Outputs all POST parameters to a text file. The file name is the date_time of the report reception
$fileName = date('Y-m-d_H-i-s').'.txt';
$file = fopen($fileName,'w') or die('Could not create report file: ' . $fileName);
foreach($_POST as $key => $value) {
$reportLine = $key." = ".$value."\n";
fwrite($file, $reportLine) or die ('Could not write to report file ' . $reportLine);
}
fclose($file);
?>是的,我在我的build.cradle中包含了acra-http
compile 'ch.acra:acra-core:5.0.1'编译'ch.acra:acra-http:5.0.1‘
所以有人知道我的错误在哪里吗?
发布于 2018-02-18 22:46:58
此issue已在ACRA版本5.0.2中修复
https://stackoverflow.com/questions/48468651
复制相似问题