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?










share|improve this question





















  • 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















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?










share|improve this question





















  • 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













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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 the ACRA 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










  • 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
















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













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.






share|improve this answer



























    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.






    share|improve this answer




















      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
      );



      );













      draft saved

      draft discarded


















      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.






      share|improve this answer
























        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.






        share|improve this answer






















          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 10 at 14:16









          wpbloger

          398




          398






















              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 11 at 19:59









                  ban-geoengineering

                  7,5411084169




                  7,5411084169



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      這個網誌中的熱門文章

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3

                      Museum of Modern and Contemporary Art of Trento and Rovereto