ACRA does not send report crash using HttpSender
up vote
1
down vote
favorite
I installed the Acre extension as written in the acre documentation.
And added the @AcraHttpSender
anatomy indicated the site and the sending method in it.
But when I throw an exception or use the following command ACRA.getErrorReporter().handleException(new Exception("123"));
, nothing happens to the server.
Although I have a permission to access the network in the manifest and the Internet is always on.
Why is not sending?
And is there a way to manually send accumulated reports using the service after a certain period of time?
android acra
add a comment |
up vote
1
down vote
favorite
I installed the Acre extension as written in the acre documentation.
And added the @AcraHttpSender
anatomy indicated the site and the sending method in it.
But when I throw an exception or use the following command ACRA.getErrorReporter().handleException(new Exception("123"));
, nothing happens to the server.
Although I have a permission to access the network in the manifest and the Internet is always on.
Why is not sending?
And is there a way to manually send accumulated reports using the service after a certain period of time?
android acra
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Check your logcat for messages with theACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.
– F43nd1r
Jan 10 at 4:16
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I installed the Acre extension as written in the acre documentation.
And added the @AcraHttpSender
anatomy indicated the site and the sending method in it.
But when I throw an exception or use the following command ACRA.getErrorReporter().handleException(new Exception("123"));
, nothing happens to the server.
Although I have a permission to access the network in the manifest and the Internet is always on.
Why is not sending?
And is there a way to manually send accumulated reports using the service after a certain period of time?
android acra
I installed the Acre extension as written in the acre documentation.
And added the @AcraHttpSender
anatomy indicated the site and the sending method in it.
But when I throw an exception or use the following command ACRA.getErrorReporter().handleException(new Exception("123"));
, nothing happens to the server.
Although I have a permission to access the network in the manifest and the Internet is always on.
Why is not sending?
And is there a way to manually send accumulated reports using the service after a certain period of time?
android acra
android acra
asked Jan 9 at 17:13
wpbloger
398
398
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Check your logcat for messages with theACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.
– F43nd1r
Jan 10 at 4:16
add a comment |
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Check your logcat for messages with theACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.
– F43nd1r
Jan 10 at 4:16
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Check your logcat for messages with the
ACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.– F43nd1r
Jan 10 at 4:16
Check your logcat for messages with the
ACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.– F43nd1r
Jan 10 at 4:16
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
I was wrong, I checked the data in the $_POST
array, which produced a negative result and the logs were not written, you should use the input stream reading directly like this file_get_contents('php://input');
The question can be considered closed, thank you all, the ACRA logs helped to see that the data is not written to the server.
add a comment |
up vote
0
down vote
I had exactly the same issue. If it helps anyone else out, here is my MyApplication.java:
@AcraCore(
buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON
)
@AcraHttpSender(
uri = "https://example.org/my_acra_script.php",
httpMethod = HttpSender.Method.POST
)
public class MyApplication extends Application
@Override
public void onCreate()
super.onCreate();
@Override
protected void attachBaseContext(Context base)
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
...just change the uri
value.
And here is my_acra_script.php:
<?php
$NEW_LINE = "rn";
$from = "server@example.org";
$to = "you@example.org";
$subject = "Android Crash Report";
$headers = "From: $from" . $NEW_LINE;
$headers .= 'MIME-Version: 1.0' . $NEW_LINE;
$headers .= 'Content-type: text/html; charset=utf-8' . $NEW_LINE;
$message = "<html>";
$message .= " <head>";
$message .= " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
$message .= " <title>$subject</title>";
$message .= " </head>";
$message .= " <body>";
$message .= " <p>";
$post_data = file_get_contents('php://input');
if (empty($post_data))
$message .= "No data received.";
else
$error_data = json_decode($post_data, true);
foreach ($error_data as $key => $value)
$message .= "<br /><b>" . nl2br(htmlspecialchars($key)) . ":</b><br />" . nl2br(htmlspecialchars($value)) . "<br />" . $NEW_LINE;
$message .= " </p>";
$message .= " </body>";
$message .= "</html>";
$result = mail($to, $subject, $message, $headers);
if ($result === TRUE)
echo "OK";
else
error_log("ACRA email not sent.");
?>
...just change the $from
and $to
values.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48173411%2facra-does-not-send-report-crash-using-httpsender%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I was wrong, I checked the data in the $_POST
array, which produced a negative result and the logs were not written, you should use the input stream reading directly like this file_get_contents('php://input');
The question can be considered closed, thank you all, the ACRA logs helped to see that the data is not written to the server.
add a comment |
up vote
1
down vote
I was wrong, I checked the data in the $_POST
array, which produced a negative result and the logs were not written, you should use the input stream reading directly like this file_get_contents('php://input');
The question can be considered closed, thank you all, the ACRA logs helped to see that the data is not written to the server.
add a comment |
up vote
1
down vote
up vote
1
down vote
I was wrong, I checked the data in the $_POST
array, which produced a negative result and the logs were not written, you should use the input stream reading directly like this file_get_contents('php://input');
The question can be considered closed, thank you all, the ACRA logs helped to see that the data is not written to the server.
I was wrong, I checked the data in the $_POST
array, which produced a negative result and the logs were not written, you should use the input stream reading directly like this file_get_contents('php://input');
The question can be considered closed, thank you all, the ACRA logs helped to see that the data is not written to the server.
answered Jan 10 at 14:16
wpbloger
398
398
add a comment |
add a comment |
up vote
0
down vote
I had exactly the same issue. If it helps anyone else out, here is my MyApplication.java:
@AcraCore(
buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON
)
@AcraHttpSender(
uri = "https://example.org/my_acra_script.php",
httpMethod = HttpSender.Method.POST
)
public class MyApplication extends Application
@Override
public void onCreate()
super.onCreate();
@Override
protected void attachBaseContext(Context base)
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
...just change the uri
value.
And here is my_acra_script.php:
<?php
$NEW_LINE = "rn";
$from = "server@example.org";
$to = "you@example.org";
$subject = "Android Crash Report";
$headers = "From: $from" . $NEW_LINE;
$headers .= 'MIME-Version: 1.0' . $NEW_LINE;
$headers .= 'Content-type: text/html; charset=utf-8' . $NEW_LINE;
$message = "<html>";
$message .= " <head>";
$message .= " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
$message .= " <title>$subject</title>";
$message .= " </head>";
$message .= " <body>";
$message .= " <p>";
$post_data = file_get_contents('php://input');
if (empty($post_data))
$message .= "No data received.";
else
$error_data = json_decode($post_data, true);
foreach ($error_data as $key => $value)
$message .= "<br /><b>" . nl2br(htmlspecialchars($key)) . ":</b><br />" . nl2br(htmlspecialchars($value)) . "<br />" . $NEW_LINE;
$message .= " </p>";
$message .= " </body>";
$message .= "</html>";
$result = mail($to, $subject, $message, $headers);
if ($result === TRUE)
echo "OK";
else
error_log("ACRA email not sent.");
?>
...just change the $from
and $to
values.
add a comment |
up vote
0
down vote
I had exactly the same issue. If it helps anyone else out, here is my MyApplication.java:
@AcraCore(
buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON
)
@AcraHttpSender(
uri = "https://example.org/my_acra_script.php",
httpMethod = HttpSender.Method.POST
)
public class MyApplication extends Application
@Override
public void onCreate()
super.onCreate();
@Override
protected void attachBaseContext(Context base)
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
...just change the uri
value.
And here is my_acra_script.php:
<?php
$NEW_LINE = "rn";
$from = "server@example.org";
$to = "you@example.org";
$subject = "Android Crash Report";
$headers = "From: $from" . $NEW_LINE;
$headers .= 'MIME-Version: 1.0' . $NEW_LINE;
$headers .= 'Content-type: text/html; charset=utf-8' . $NEW_LINE;
$message = "<html>";
$message .= " <head>";
$message .= " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
$message .= " <title>$subject</title>";
$message .= " </head>";
$message .= " <body>";
$message .= " <p>";
$post_data = file_get_contents('php://input');
if (empty($post_data))
$message .= "No data received.";
else
$error_data = json_decode($post_data, true);
foreach ($error_data as $key => $value)
$message .= "<br /><b>" . nl2br(htmlspecialchars($key)) . ":</b><br />" . nl2br(htmlspecialchars($value)) . "<br />" . $NEW_LINE;
$message .= " </p>";
$message .= " </body>";
$message .= "</html>";
$result = mail($to, $subject, $message, $headers);
if ($result === TRUE)
echo "OK";
else
error_log("ACRA email not sent.");
?>
...just change the $from
and $to
values.
add a comment |
up vote
0
down vote
up vote
0
down vote
I had exactly the same issue. If it helps anyone else out, here is my MyApplication.java:
@AcraCore(
buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON
)
@AcraHttpSender(
uri = "https://example.org/my_acra_script.php",
httpMethod = HttpSender.Method.POST
)
public class MyApplication extends Application
@Override
public void onCreate()
super.onCreate();
@Override
protected void attachBaseContext(Context base)
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
...just change the uri
value.
And here is my_acra_script.php:
<?php
$NEW_LINE = "rn";
$from = "server@example.org";
$to = "you@example.org";
$subject = "Android Crash Report";
$headers = "From: $from" . $NEW_LINE;
$headers .= 'MIME-Version: 1.0' . $NEW_LINE;
$headers .= 'Content-type: text/html; charset=utf-8' . $NEW_LINE;
$message = "<html>";
$message .= " <head>";
$message .= " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
$message .= " <title>$subject</title>";
$message .= " </head>";
$message .= " <body>";
$message .= " <p>";
$post_data = file_get_contents('php://input');
if (empty($post_data))
$message .= "No data received.";
else
$error_data = json_decode($post_data, true);
foreach ($error_data as $key => $value)
$message .= "<br /><b>" . nl2br(htmlspecialchars($key)) . ":</b><br />" . nl2br(htmlspecialchars($value)) . "<br />" . $NEW_LINE;
$message .= " </p>";
$message .= " </body>";
$message .= "</html>";
$result = mail($to, $subject, $message, $headers);
if ($result === TRUE)
echo "OK";
else
error_log("ACRA email not sent.");
?>
...just change the $from
and $to
values.
I had exactly the same issue. If it helps anyone else out, here is my MyApplication.java:
@AcraCore(
buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON
)
@AcraHttpSender(
uri = "https://example.org/my_acra_script.php",
httpMethod = HttpSender.Method.POST
)
public class MyApplication extends Application
@Override
public void onCreate()
super.onCreate();
@Override
protected void attachBaseContext(Context base)
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
...just change the uri
value.
And here is my_acra_script.php:
<?php
$NEW_LINE = "rn";
$from = "server@example.org";
$to = "you@example.org";
$subject = "Android Crash Report";
$headers = "From: $from" . $NEW_LINE;
$headers .= 'MIME-Version: 1.0' . $NEW_LINE;
$headers .= 'Content-type: text/html; charset=utf-8' . $NEW_LINE;
$message = "<html>";
$message .= " <head>";
$message .= " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
$message .= " <title>$subject</title>";
$message .= " </head>";
$message .= " <body>";
$message .= " <p>";
$post_data = file_get_contents('php://input');
if (empty($post_data))
$message .= "No data received.";
else
$error_data = json_decode($post_data, true);
foreach ($error_data as $key => $value)
$message .= "<br /><b>" . nl2br(htmlspecialchars($key)) . ":</b><br />" . nl2br(htmlspecialchars($value)) . "<br />" . $NEW_LINE;
$message .= " </p>";
$message .= " </body>";
$message .= "</html>";
$result = mail($to, $subject, $message, $headers);
if ($result === TRUE)
echo "OK";
else
error_log("ACRA email not sent.");
?>
...just change the $from
and $to
values.
answered Nov 11 at 19:59
ban-geoengineering
7,5411084169
7,5411084169
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48173411%2facra-does-not-send-report-crash-using-httpsender%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share your code. FYI ACRA needs a gmail emailID and Password for configuration to trigger the email
– Arshad
Jan 9 at 17:37
Check your logcat for messages with the
ACRA
tag. What @Arshad said is false, email is only required for EmailSender, password is never required.– F43nd1r
Jan 10 at 4:16