New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624089 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: ----



Sign in to add a comment

[Webview]Pandora app crashes on launch

Project Member Reported by ppolise...@chromium.org, Jun 28 2016

Issue description

Webview : 53.0.2774.2
Devices: Dell Venue 10 7040/LMY47I, ASUS Zenpad S8.0(X86_64)/LRX21V, OnePlus/LRX22G
Application Version: 7.3

Steps to reproduce: 
1. Install and launch the app
2. Tap on login and enter the login details

Observed behavior: App crashes on launch or when the user is able to proceed after entering the log in details.

Expected behavior: No crash

Frequency: 
5/5

Additional comments: Issue does on happen on Beta version of webview 52.0.2743.49, tested on Dell Venue 10 7040

 
also happens on Nexus 6, MOB30Q, 53.0.2774.2

Comment 3 by sgu...@chromium.org, Jun 28 2016

/AndroidRuntime( 4187): java.lang.NoClassDefFoundError: android.webkit.ServiceWorkerController
E/AndroidRuntime( 4187): 	at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
E/AndroidRuntime( 4187): 	at java.lang.Class.getDexCacheType(Class.java:476)
E/AndroidRuntime( 4187): 	at java.lang.reflect.ArtField.getType(ArtField.java:94)
E/AndroidRuntime( 4187): 	at java.lang.reflect.Field.getType(Field.java:135)
E/AndroidRuntime( 4187): 	at java.lang.Class.getDeclaredFields(Class.java:909)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.al.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.al.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.al.<init>(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.bh.<init>(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.ag.<init>(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.ah.<init>(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.bm.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.y.b(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.y.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.z.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.u.a(Unknown Source)
E/AndroidRuntime( 4187): 	at com.moat.analytics.mobile.w.run(Unknown Source)
E/AndroidRuntime( 4187): 	at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 4187): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4187): 	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 4187): 	at android.app.ActivityThread.main(ActivityThread.java:5258)
E/AndroidRuntime( 4187): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4187): 	at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 4187): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 4187): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Comment 4 by sgu...@chromium.org, Jun 28 2016

ServiceWorkerController is a WebView API that is published in Android N. Seems the app (the analytics library) is trying to access it in a Pre-N device using reflection and crashing. 


Comment 5 by sgu...@chromium.org, Jun 28 2016

Status: WontFix (was: Untriaged)

Comment 6 by sgu...@chromium.org, Jun 30 2016

Cc: sgu...@chromium.org
 Issue 624896  has been merged into this issue.
Labels: -Restrict-View-Google
 Issue 625119  has been merged into this issue.
Cc: -sgu...@chromium.org
Owner: sgu...@chromium.org
Status: Assigned (was: WontFix)
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/d4020c004324666e1387ed389a30d6929ed5927c

commit d4020c004324666e1387ed389a30d6929ed5927c
Author: Selim Gurun <sgurun@google.com>
Date: Fri Jul 08 21:12:20 2016

Project Member

Comment 11 by sheriffbot@chromium.org, Jul 9 2016

Labels: -M-53 M-54 MovedFrom-53
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
What is the logic behind the change in Comment #10? Do the apps try to fetch each class that is used in our code?

Comment 13 by torne@chromium.org, Jul 11 2016

Yes, that's exactly what they're doing.

I looked into the decompiled code a bit, and I think I've figured out what the point of this code is: they're implementing a getWebViewClient method in what they probably believed was a future-proof way, which is ironically causing a compatibility issue in a way that implementing it in a much simpler and less future-proof way would not :/

It creates a temporary WebView and a temporary WebViewClient, and calls setWebViewClient to associate them. It then searches (breadth-first i think?) through all fields of the WebView class, and all fields of all classes referenced by the WebView class, and so on, until it finds a field which 1) has its value set to the temporary WebViewClient and 2) has a type that's assignable to WebViewClient. It then makes a note of the "path" of field names that leads from the WebView to that field. Having done that, it can then use that path to get the WebViewClient associated with any WebView instance: they've implemented "getWebViewClient".

If they'd just hardcoded the list of fields to use on each Android version, this would probably have been fine: I suspect there's only three versions required (the old webview pre-JB, the old webview on JB where we had inserted the extra abstraction to switch webviews, and the new webview on KK+) since this isn't something we've had much reason to change, and it would remove the need to call getDeclaredFields which is what crashes here.

We should probably add getters for WebViewClient and WebChromeClient (and any other fields we currently only have a setter for) in the next version of Android, just to prevent people needing to do this kind of crazy thing in future.
yeah we need to add an API in the next version. 
Torne's explanation is pretty much correct. They tried to solve it such that it would continue to work even when we change webview internal names but then failed when new types that did not exist in previous SDK are added.
Labels: Merge-Request-52 Merge-Request-53

Comment 16 by dimu@google.com, Jul 12 2016

Labels: -Merge-Request-52 Merge-Review-52 Hotlist-Merge-Review
[Automated comment] Less than 2 weeks to go before stable on M52, manual review required.

Comment 17 by dimu@google.com, Jul 12 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Labels: -Merge-Request-52 Merge-Approved-52
Merge approved for M52 branch 2743.
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 12 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/d868d58a78ed85eb5b2ea2cdf76ea945bd1fb6c7

commit d868d58a78ed85eb5b2ea2cdf76ea945bd1fb6c7
Author: Selim Gurun <sgurun@google.com>
Date: Fri Jul 08 21:12:20 2016

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 12 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/358d8e548ffa82be9e25137c0573d785c288263d

commit 358d8e548ffa82be9e25137c0573d785c288263d
Author: Selim Gurun <sgurun@google.com>
Date: Fri Jul 08 21:12:20 2016

Status: Fixed (was: Assigned)
 Issue 627551  has been merged into this issue.
Status: Verified (was: Fixed)
Fix verified, crash no longer reproducible, tested on Dell Venue 10 7040/LMY47I, Webview: 52.0.2743.79 & 53.0.2785.20

Sign in to add a comment