Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InAppBrowser: java.lang.IllegalArgumentException #470

Closed
paamrutk opened this issue May 2, 2019 · 19 comments · Fixed by #616 · May be fixed by #1018
Closed

InAppBrowser: java.lang.IllegalArgumentException #470

paamrutk opened this issue May 2, 2019 · 19 comments · Fixed by #616 · May be fixed by #1018

Comments

@paamrutk
Copy link

paamrutk commented May 2, 2019

Hello all,

We have found this error on Google Play Store console that seams to be an InAppBrowser problem

java.lang.IllegalArgumentException: 
  at android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:533)
  at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:433)
  at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:124)
  at android.app.Dialog.dismissDialog (Dialog.java:518)
  at android.app.Dialog.dismiss (Dialog.java:501)
  at org.apache.cordova.inappbrowser.InAppBrowser$5$1.onPageFinished (InAppBrowser.java:462)
  at vu.d (PG:307)
  at aCg.handleMessage (PG:72)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7032)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)

Please help on this I am getting this crash issue frequently.

@janpio
Copy link
Member

janpio commented May 2, 2019

What version of the plugin?
What version of Cordova Android?

@paamrutk
Copy link
Author

paamrutk commented May 2, 2019

Plugin Version:3.0.0
Cordova Android Version:7.1.4

@lknop
Copy link

lknop commented May 8, 2019

@janpio I have a bit more details. The issue also happens in cordova-android 8.0.0. We have an app with the inappbrowser plugin version built from master branch around February and it was not fixed by then.

Judging from the statistics, the problem is prevalent in Samsung phones (~80% of cases) but also visible in Huawei and others. Regarding android version, we had single instances in android 6, and the newer the version the more frequent the problem. Currently 95% cases is android 9.

@janpio
Copy link
Member

janpio commented May 8, 2019

Thanks @lknop, that is valuable information. (Btw. we will soon do a new minor/path release to get current master out)

Is this reproducible in any way? Best on an emulator?

@lknop
Copy link

lknop commented May 13, 2019

We are struggling to reproduce the issue, did not happen on any emulator, and we cannot cause the app to crash repeatably but sometimes we get a samsung phone to crash somehow. I'll report back if we have any success.

@timbru31
Copy link
Member

We are seeing the crash, too (only Samsung devices and Android 9). Unfortunately I have no reproducible example neither.

image

@EmeryGuillaume
Copy link

Hello, we are also seeing this issue in our google play console (Cordova-android 8 / inappbrowser 3)
Attached is the devices and versions repartition.
I haven't found any way to reproduce the issue...
screen playstore

@DooDiddle
Copy link

DooDiddle commented May 21, 2019

Hello, I see the same issue:
Samsung Galaxy S9 (starqltesq), Android 9

java.lang.IllegalArgumentException: 
  at android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:533)
  at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:433)
  at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:124)
  at android.app.Dialog.dismissDialog (Dialog.java:518)
  at android.app.Dialog.dismiss (Dialog.java:501)
  at org.apache.cordova.inappbrowser.InAppBrowser$5$1.onPageFinished (InAppBrowser.java:462)
  at vl.d (PG:307)
  at aHZ.handleMessage (PG:72)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:6981)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1445)

@ceyhunkeklik
Copy link

Is this issue resolved on 3.1.0?

@janpio
Copy link
Member

janpio commented Jul 4, 2019

I don't see a Pull Request referenced here that could have fixed this @ceyhunkeklik, so probably no (unless via unrelated changes).

Biggest problem is that until now there is no reproduction for this - so we don't understand why it is happening and how we could properly fix it.

@ceyhunkeklik
Copy link

ceyhunkeklik commented Jul 5, 2019

We've faced this issue on Android 8.1 and Android 9 devices. Our crash logs almost the same as the other ones.

java.lang.IllegalArgumentException:
at android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:454)
at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:380)
at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:140)
at android.app.Dialog.dismissDialog (Dialog.java:687)
at android.app.Dialog.dismiss (Dialog.java:670)
at org.apache.cordova.inappbrowser.InAppBrowser$4$1.onPageFinished (Unknown Source)
at ib.d (PG:323)
at Ae.handleMessage (PG:72)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:7223)
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)

@syagawa
Copy link

syagawa commented Jul 8, 2019

We are facing the same problem. In our app, the incidence rate is high in Samsung Galaxy S9, but it is also occurring in Sony Xperia XZ2 Compact.

@lethe2211
Copy link

lethe2211 commented Jul 23, 2019

Hi, let me share our case...
I'm using inappbrowser 3.0.0 with Cordova 7.1.0 / cordova-android 6.4.0.

Here are the results on our Firebase Console.

Fatal Exception: java.lang.IllegalArgumentException: View=DecorView@9fcd2f6[MainActivity] not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked + 485(WindowManagerGlobal.java:485)
at android.view.WindowManagerGlobal.removeView + 394(WindowManagerGlobal.java:394)
at android.view.WindowManagerImpl.removeViewImmediate + 126(WindowManagerImpl.java:126)
at android.app.Dialog.dismissDialog + 375(Dialog.java:375)
at android.app.Dialog.dismiss + 358(Dialog.java:358)
at org.apache.cordova.inappbrowser.InAppBrowser$5$1.onPageFinished + 462(InAppBrowser.java:462)
at uU.d + 307(PG:307)
at aIV.handleMessage + 73(PG:73)
at android.os.Handler.dispatchMessage + 106(Handler.java:106)
at android.os.Looper.loop + 338(Looper.java:338)
at android.app.ActivityThread.main + 6764(ActivityThread.java:6764)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main + 858(ZygoteInit.java:858)

Almost all are from Android 9.

image

And several devices caused this issue.

image
image
image

Also, it happens after the app becomes foreground from background status.

image

Hope it helps.

@morou
Copy link

morou commented Jul 27, 2019

Is this related to #348 ?

@uqbMtran
Copy link

https://issues.apache.org/jira/browse/CB-13259

@springbov
Copy link

springbov commented Nov 12, 2019

We had this issue happen in our 'pre-launch report' before releasing on the play store.
I'm uploading the logcat file (with our product id replaced with com.companyname.product), and the test device info which it had failed on.

The log cat file is 35 megabytes un compressed, so I've zipped it to be more manageable.
logcat_with_redactions.zip

edit: we're using cordova android 8.0.0 and cordova-plugin-inappbrowser 3.1.0

image

FATAL EXCEPTION: main
Process: com.companyname.product, PID: 17295
java.lang.IllegalArgumentException: View=DecorView@c24883a[MainActivity] not attached to window manager
	at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:485)
	at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:394)
	at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:124)
	at android.app.Dialog.dismissDialog(Dialog.java:375)
	at android.app.Dialog.dismiss(Dialog.java:358)
	at org.apache.cordova.inappbrowser.InAppBrowser$6$1.onPageFinished(InAppBrowser.java:537)
	at sV.d(PG:311)
	at aHF.handleMessage(PG:73)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6718)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

@JeetuChoudhary
Copy link

We are also facing the same issue. And It is occurring around 90% in Samsung Devices on Android 9.
Our Project Info is Following:

Ionic Framework Version: 3.20.0
Cordova version: 9.0.0 (cordova-lib@9.0.1)
cordova-android: 8.0.0
InAppBrowser: ^3.0.0

Crash Showing in Firebase Crashlytics is the following:

Fatal Exception: java.lang.IllegalArgumentException: View=DecorView@ad05060[MainActivity] not attached to window manager
       at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:533)
       at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:433)
       at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:124)
       at android.app.Dialog.dismissDialog(Dialog.java:518)
       at android.app.Dialog.dismiss(Dialog.java:501)
       at org.apache.cordova.inappbrowser.InAppBrowser$6$1.onPageFinished(InAppBrowser.java:537)
       at pn.b(PG:2)
       at cC0.handleMessage(PG:64)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7050)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

image

You Might get Successful to reproduce it by doing the following:
This is a crash caused by your app dismissing a dialog attached to an Activity that is finishing or finished. This can happen in a number of ways -- for example, if an AsyncTask is running while a ProgressDialog is showing, and the user rotates the device, causing the Activity to be recreated.

@ricard-pons
Copy link

Still having the same error log in the Play Console for Android 9 with 5.11.0 version of the plugin and Cordova 8.1.0.
Has anyone found a workaround to fix this?

@mjamal4u
Copy link

From our stats we can see this issue is with most of the Samsung Devices only. I am pretty sure we don't code at Manufacture level. For our App 95% of crashes is only for Samsung devices.

Slayterik pushed a commit to Slayterik/cordova-plugin-inappbrowser that referenced this issue Jan 23, 2020
Slayterik pushed a commit to Slayterik/cordova-plugin-inappbrowser that referenced this issue Jan 27, 2020
Slayterik pushed a commit to Slayterik/cordova-plugin-inappbrowser that referenced this issue Jan 27, 2020
timbru31 pushed a commit that referenced this issue Mar 20, 2020
Fix interacting with views when Activity destroyed
Bug description https://stackoverflow.com/questions/22924825/view-not-attached-to-window-manager-crash

Co-authored-by: Sarafanov Valeriy <sarafanov_v@firma-gamma.ru>
expertanswerz pushed a commit to expertanswerz/cordova-plugin-inappbrowser that referenced this issue Apr 9, 2020
* master:
  docs: replaces outdated transition and presentation style links (apache#662)
  chore: remove deprecated orientation methods (apache#666)
  Fix incorrect TypeScript typings (apache#515)
  [apacheGH-652] add check for openInSystem postNotification (apache#654)
  ci: updates Node.js versions (apache#659)
  chore(npm): improve ignore list (apache#658)
  fix(android): Reset lefttoright if not set (apache#442)
  [android] Correcting the documentation regarding lefttoright opt… (apache#648)
  (android) Added option to turn on/off fullscreen mode in Android (apache#634)
  Android apacheGH-470 InAppBrowser: java.lang.IllegalArgumentException (apache#616)
  breaking(ios): remove UIWebView (apache#635)
  chore(release): 3.2.1-dev
rufiange pushed a commit to jalios/cordova-plugin-inappbrowser that referenced this issue Apr 15, 2020
…apache#616)

Fix interacting with views when Activity destroyed
Bug description https://stackoverflow.com/questions/22924825/view-not-attached-to-window-manager-crash

Co-authored-by: Sarafanov Valeriy <sarafanov_v@firma-gamma.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment