pwlin / cordova-plugin-pdialog

An Android Progress Dialog Plugin for Cordova
MIT License
22 stars 14 forks source link

Crash reports on Play Console #12

Open mirko77 opened 7 years ago

mirko77 commented 7 years ago

Hi there,

I am not personally experiencing any problems, but I get loads of crash reports on the Play Console.

This:

java.lang.NumberFormatException: 
  at java.lang.Integer.parseInt (Integer.java:521)
  at java.lang.Integer.parseInt (Integer.java:556)
  at io.github.pwlin.cordova.plugins.pdialog.PDialog$3.run (PDialog.java:192)
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6682)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)

and this:

java.lang.IllegalArgumentException: 
  at android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:451)
  at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:377)
  at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:122)
  at android.app.Dialog.dismissDialog (Dialog.java:546)
  at android.app.Dialog.dismiss (Dialog.java:529)
  at io.github.pwlin.cordova.plugins.pdialog.PDialog$1.run (PDialog.java:87)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:158)
  at android.app.ActivityThread.main (ActivityThread.java:7229)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

Please advise

KleggerKoder commented 7 years ago

@mirko77 I created fork that fixes this issue, I'd post a pull request here but it doesn't look actively maintained anymore.

mirko77 commented 7 years ago

@KleggerKoder I'll have a look at your fork then, thanks.

mirko77 commented 6 years ago

I am still getting the second crash at line 87 java.lang.IllegalArgumentException:

I wonder if we need to put:

if (cordova.getActivity().isDestroyed()) { // or call isFinishing() if min sdk version < 17
    return;
 } 

before trying to dismiss the dialog at line 86?

if (PDialog.pDialogObj != null && PDialog.pDialogObj.isShowing()) {
    PDialog.pDialogObj.dismiss();
    PDialog.pDialogObj = null;
}