My app does not run on android Lollipop

Asked

Viewed 161 times

1

At a certain point in my app, payment occurs with pagseguro, and for this I open a page in a webview, responsible for this service (passing the card data by GET). When the page finishes being processed, the title of it changes with the status of the operation, and so I can pick up to work on android (yes, it is a gambiarra). The problem is that in my client’s mobile does not run, android 5.1.1 . The payment is processing until crash in the application. I installed the API 22, related to android 5.1, I created the emulator in android studio and it worked fine. With API 23 it also works on emulator and on my phone.

Could someone help me?

Follows the webview module

private void iniciaPagamentoCartao(String url, final Agenda agenda) { //1==cartao, 2==boleto
    webView.setWebViewClient(new WebViewClient() {

        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }

        public void onLoadResource (WebView view, String url) {
            if (progressDialogPagamentoCartao == null) {
                progressDialogPagamentoCartao = ProgressDialog.show(act_principal.this,"Processando pagamento","Aguarde...",false,false);
            }
        }
        public void onPageFinished(final WebView view, String url) {


            public void onFinish() {
                String tituloPagina = webView.getTitle().toString();
                switch(tituloPagina)
                {
                    case "Erro contate o administrador":
                        progressDialogPagamentoCartao.dismiss();
                        progressDialogPagamentoCartao = null;

                        Toast.makeText(act_principal.this, "Erro interno. Contate o administrador!", Toast.LENGTH_LONG).show();
                        break;

                    case "Erro no cartao de credito":
                        progressDialogPagamentoCartao.dismiss();
                        progressDialogPagamentoCartao = null;

                        Toast.makeText(act_principal.this, "Erro no cartão de crédito!", Toast.LENGTH_LONG).show();
                        break;

                    default:
                        //faz as outras rotinas necessárias
                        String codigoTransacao[] = tituloPagina.split("~");
                        confirmaPagamento(1, agenda, codigoTransacao[1]);

                        progressDialogPagamentoCartao.dismiss();
                        progressDialogPagamentoCartao = null;
                        break;
                }
            }

        }
    });

    webView.getSettings().setJavaScriptEnabled(true);
    webView.loadUrl(url);
}
  • This is the problem. As it is in the customer’s cell phone, it is not possible to debug and see the error. The application simply crashes and closes. " The app stopped responding"

  • There’s no way you can fake the problem?

  • No, because for me there is no error, it works normally, me using the emulator with api 22 or with 23.

  • Have you noticed if there was an internet crash at the time of the transaction? Do you have any crash logs? Have you heard of Fabric ? Yeah, Google just bought it. Try to adapt Fabric inside your app, it’s very cool and useful. It’s an improved version of Google Analytics, but uses crashlytics for control.

  • Probably there wasn’t. I saw that I had joined with firebase, but I didn’t dig deep into it. I’ll take a look. Thanks

  • It is not Firebase, it is Fabric. See: http://fabric.io/blog/fabric-joins-google/

  • https://firebase.googleblog.com/2017/01/FabricJoinsGoogle17.html -- Fabric and Firebase Joining Forces

  • Honestly, I find it very difficult to find an answer, because maybe you can’t reproduce considering the amount of code. Even more that also has the webview, and maybe, I say maybe, to make the reproduction of the error the person will have to make a purchase using the pagseguro. hehe

  • Firebase was gone before. Now Fabric has come. But anyway, my tip is you implement Fabric, send the app again, then the customer will do the same stream as before. This way, it will send to the history of crashs inside Fabri’s Adm panel, where you will see exactly what the error was.

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.