gree / gree/unity-webview

WebView automatically reload( Android version 6.0.1)

Open
#404 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

Description

Hello,
I found the problem on the Android version 6.0.1 with WebView, I tested it on the other android versions and it's works fine.
In my case I show a sample web page, and it load it well, but for no reason it automatically reload it.
I use AndroidStudio to see the log and I detected that after the page is shown it triggered OnPause and after that OnResume. So, for no reason only on the version 6.0.1 it restart Activity automatically and give me a Toast with the message "Cannot display the PDF (573.36 cannot be opened)"

(Filename: C Line: 0)

03-18 16:43:25.205 29657-29687/com.softatec.TheRoseKing I/Unity: CallFromJS[ua=Mozilla/5.0 (Linux; Android 6.0.1; SM-T800 Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.75 Safari/537.36]
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
c__Iterator0:<>m__0(String)
WebViewObject:CallFromJS(String) (at C:\Users\Mirsad\Documents\projects\the-rose-king\Assets\Scripts\MoreGames\WebViewObject.cs:684)

(Filename: C Line: 0)

03-18 16:43:25.205 29657-29687/com.softatec.TheRoseKing I/Unity: Open url: ua=Mozilla/5.0 (Linux; Android 6.0.1; SM-T800 Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.75 Safari/537.36
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
c__Iterator0:<>m__0(String) (at C:\Users\Mirsad\Documents\projects\the-rose-king\Assets\Scripts\MoreGames\WebViewHandler.cs:64)
WebViewObject:CallFromJS(String) (at C:\Users\Mirsad\Documents\projects\the-rose-king\Assets\Scripts\MoreGames\WebViewObject.cs:684)

(Filename: C Line: 0)

03-18 16:43:25.405 29657-29657/com.softatec.TheRoseKing I/Unity: onPause
03-18 16:43:25.435 29657-29748/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:25.435 29657-29748/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:25.500 29657-29687/com.softatec.TheRoseKing I/sensor: ASensor_disable: handle:0, name:BMI055 Accelerometer Sensor, ret:0
03-18 16:43:25.500 29657-29687/com.softatec.TheRoseKing D/Unity: Sensor : Accelerometer ( 1) ; 0.038307 / 0.01s ; BMI055 Accelerometer Sensor / Bosch Sensortec
03-18 16:43:25.615 29657-29749/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:25.615 29657-29749/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:25.655 29657-29657/com.softatec.TheRoseKing I/Unity: windowFocusChanged: false
03-18 16:43:25.680 29657-29687/com.softatec.TheRoseKing D/Unity: SetWindow 0 0x0
03-18 16:43:25.820 29657-29687/com.softatec.TheRoseKing D/Unity: SetWindow 0 0xa9d7e808
03-18 16:43:25.820 29657-29687/com.softatec.TheRoseKing D/Unity: SetWindow 0 0xa9d7e808
03-18 16:43:25.855 29657-29657/com.softatec.TheRoseKing I/Unity: onResume
03-18 16:43:25.930 29657-29657/com.softatec.TheRoseKing I/Unity: windowFocusChanged: true
03-18 16:43:25.935 29657-29687/com.softatec.TheRoseKing D/Unity: [EGL] Attaching window :0xa9d7e808
03-18 16:43:25.935 29657-29657/com.softatec.TheRoseKing I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@28e932c time:22745259
03-18 16:43:25.975 29657-29687/com.softatec.TheRoseKing D/mali_winsys: new_window_surface returns 0x3000, [1600x2560]-format:1
03-18 16:43:26.020 29657-29687/com.softatec.TheRoseKing D/Unity: ANativeWindow: (1600/2560) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1600/2560)
03-18 16:43:26.030 29657-29687/com.softatec.TheRoseKing I/sensor: ASensor_enable: handle:0, name:BMI055 Accelerometer Sensor, ret:0
03-18 16:43:26.035 29657-29687/com.softatec.TheRoseKing I/sensor: ASensor_setEventRate: handle:0, name:BMI055 Accelerometer Sensor, delay:20000, ret:0
03-18 16:43:26.035 29657-29687/com.softatec.TheRoseKing D/Unity: Sensor : Accelerometer ( 1) ; 0.038307 / 0.01s ; BMI055 Accelerometer Sensor / Bosch Sensortec
03-18 16:43:26.035 29657-29687/com.softatec.TheRoseKing D/Unity: Choreographer available: Enabling VSYNC timing
03-18 16:43:26.050 29657-29750/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:26.050 29657-29750/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:32.235 29657-29919/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
03-18 16:43:32.235 29657-29919/com.softatec.TheRoseKing I/System.out: (HTTPLog)-Static: isSBSettingEnabled false

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the WebView lifecycle behavior on Android 6.0.1 using the supplied logs and the WebViewObject.cs and WebViewHandler.cs call sites. Trace the onPause/onResume sequence and PDF error, then compare it with another Android version. Done means the cause is identified and the page no longer reloads unexpectedly on the affected version.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, unity
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.