Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Unable to load any site via tile or URL on emulator (Use System WebView) #854

Closed
AaronMT opened this issue Apr 24, 2018 · 12 comments
Closed
Assignees
Labels
🐞 bug size S 2 pt = 1 day = 6 - 8 hours

Comments

@AaronMT
Copy link
Contributor

AaronMT commented Apr 24, 2018

Master :facce66

Tap on any tile or load a URL from the address-bar, nothing loads.

However loading a URL directly from ADB works

adb shell am start -a android.intent.action.VIEW -n "org.mozilla.tv.firefox.debug/org.mozilla.focus.MainActivity" -d "http://www.google.ca"

This is happening in my AVD, have not tried hardware.

@bbinto bbinto added this to the v3.0 milestone Apr 24, 2018
@mcomella
Copy link
Contributor

@AaronMT I can't reproduce. I think I've seen this before and I've had to restart, or cold boot (through the AS UI), the AVD to get it to work again. Can you try it and see if you can still repro?

@AaronMT
Copy link
Contributor Author

AaronMT commented Apr 24, 2018

I've deleted and created a new AVD and this is still reproducible for me.

I see 'firefox:home' attempt to load for each tile, and on new URL input (I see the bottom left URL read 'Firefox:home' bubble fade away)

@AaronMT
Copy link
Contributor Author

AaronMT commented Apr 24, 2018

04-24 18:46:58.341 4046-4046/org.mozilla.tv.firefox.debug E/com.amazon.android.webkit.android.AndroidWebViewDelegate: Method not supported in Android WebView
java.lang.UnsupportedOperationException
at com.amazon.android.webkit.android.AndroidWebViewDelegate.getWebViewReflection(AndroidWebViewDelegate.java:901)
at com.amazon.android.webkit.android.AndroidWebViewDelegate.onResume(AndroidWebViewDelegate.java:383)
at com.amazon.android.webkit.AmazonWebView.onResume(AmazonWebView.java:826)
at org.mozilla.focus.iwebview.IWebViewLifecycleFragment.onResume(IWebViewLifecycleFragment.kt:76)

@liuche liuche changed the title Unable to load any site via tile or URL Unable to load any site via tile or URL on emulator Apr 25, 2018
@mcomella
Copy link
Contributor

@AaronMT Which version AVD are you using?

Method not supported in Android WebView

These log statements are expected: Android has these methods to call but they log them telling you they don't do anything. We keep them in just in case.

@mcomella
Copy link
Contributor

@AaronMT Can you connect to sites in Chrome? When I was in the PDX office, the wifi actually blocked DNS to my device. See https://groups.google.com/a/mozilla.com/forum/#!topic/firefox-tv/n36LZVGfEnw

@AaronMT
Copy link
Contributor Author

AaronMT commented Apr 27, 2018

I'm using Android TV (1080p) (Android 8.0, API 26 x86) and this is at home network. It's not a network issue as I can visit a website via

adb shell am start -a android.intent.action.VIEW -n "org.mozilla.tv.firefox.debug/org.mozilla.focus.MainActivity" -d "http://www.google.ca"

However not actually via tile or entering a URL. I recloned, rebuilt same issue with amazonWebViewDebug.

My take is that this still started happening with the Firefox:home changes

Fire TV stick does work.

@AaronMT
Copy link
Contributor Author

AaronMT commented May 4, 2018

Let's try and match up environments here

SDK: Android 8.1 (Oreo) API 26 installed
AVD: Android TV (1080P) (API 26)
Android Studio: 3.1.2

Also noticed no feed loaded with the Pocket mega-tile.

I can confirm the emulator has network activity based on outside app activity in the Google apps.

@liuche
Copy link
Contributor

liuche commented May 12, 2018

I made an emulator image, and I also see this.

Settings > About > privacy policy does load.

To load the pocket feed, you'll need to build master with the Pocket API key, see README (PR #911 to update this).

Lower priority because the only Amazon Fire TV devices that exist are API 22 and 25, but we should fix this at some point.

@mcomella
Copy link
Contributor

I commented out this line:

if (!isVisible) { webView?.focusedDOMElement?.cache() }

And it works. Under the hood, cache calls evalJS which calls loadUrl: I'm guessing in a newer version of Android WebView, they changed the behavior such that calling loadUrl twice in succession will execute the second load, whereas in the past, it did not (or maybe it didn't if it was a javascript: url).

We could try:

  1. Using evaluateJavascript instead of loadUrl("javascript:$js") but we'll need to use the system WebView for that
  2. Only calling cache if we're not loading a page (i.e. pass in a param in the onPreVisibility listener, if possible?) Sounds fragile and messy.

@mcomella
Copy link
Contributor

Playing around with this some more, we need to move the focus change listener back to the WebView too: the delegate doesn't receive the focus change events.

liuche added a commit to liuche/firefox-tv that referenced this issue May 15, 2018
@liuche liuche added the size S 2 pt = 1 day = 6 - 8 hours label Jun 26, 2018
@liuche
Copy link
Contributor

liuche commented Jun 26, 2018

Small because we need to 1) switch to system webview, 2) comment out above-mentioned line.

@liuche liuche changed the title Unable to load any site via tile or URL on emulator Unable to load any site via tile or URL on emulator (Use System WebView) Jun 26, 2018
@bbinto bbinto modified the milestones: v3.0, Sprint 2 (3.0) Aug 24, 2018
@liuche liuche assigned liuche and unassigned liuche Aug 27, 2018
@bbinto
Copy link
Contributor

bbinto commented Sep 7, 2018

@liuche - can this be unblocked now since we've moved to system webview?

@bbinto bbinto removed this from the Sprint 2 (3.0) milestone Sep 7, 2018
@bbinto bbinto added this to the Sprint 3 (3.0) milestone Sep 7, 2018
@liuche liuche self-assigned this Sep 10, 2018
liuche added a commit to liuche/firefox-tv that referenced this issue Sep 11, 2018
liuche added a commit to liuche/firefox-tv that referenced this issue Sep 11, 2018
liuche added a commit to liuche/firefox-tv that referenced this issue Sep 11, 2018
@liuche liuche closed this as completed in ff17503 Sep 11, 2018
liuche added a commit that referenced this issue Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug size S 2 pt = 1 day = 6 - 8 hours
Projects
None yet
Development

No branches or pull requests

4 participants