fluttercommunity / fluttercommunity/flutter_webview_plugin

Weird lag while navigating to WebviewScaffold

未关闭
#604 5 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
1.5k
派生
936
PR 合并指标
30 天内没有已合并 PR

描述

System info

Issue occurs on: both
Plugin version: 0.3.9+1
Flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-EG)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
[✓] VS Code (version 1.38.1)
[✓] Connected device (1 available)

• No issues found!

Steps to Reproduce

I'm facing a weird lag while navigating to WebviewScaffold. It's as if the body is being drawn without animation in the final location while still animating the app bar. It happens in both iOS & Android but it's more visible in iOS due to the default animation. I'm attaching gifs to show the issue

laginnavigation

lagandroid

Here is the code to reproduce it

void _openWebView({@required String title, @required String url})
  {
    widget._logger.log(message: url);
    Navigator.of(context).push(MaterialPageRoute
    (
      builder: (context)
      {
        return WebviewScaffold
        (
          url: url,
          withJavascript: true,
          clearCache: true,
          clearCookies: true,
          withZoom: false,
          appBar: TopNavBar.getAppBar(context, title, BackButton(color: Configs.current.COLORS_PRIMARY)),
          initialChild: Container
            (
            width: MediaQuery.of(context).size.width,
            color: Colors.white,
            child: Center
              (
              child: Loader
                (
                shadow: Colors.transparent,
                hasText: false,
              ),
            ),
          ),
        );
      }
    ));
  }

Logs

[+2061 ms] [DEVICE LOG] 2019-11-19 19:32:08.872626+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a43b260 - ProcessThrottler::didConnectToProcess(41542)
[        ] [DEVICE LOG] 2019-11-19 19:32:08.872738+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f72d0 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41542, name 'Web
content visibility'
[        ] [DEVICE LOG] 2019-11-19 19:32:08.872996+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x60000377a300 - WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName
[  +13 ms] [DEVICE LOG] 2019-11-19 19:32:08.887510+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2d0228 - ProcessThrottler::didConnectToProcess(41543)
[        ] [DEVICE LOG] 2019-11-19 19:32:08.887566+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7300 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41543, name 'Web
content visibility'
[        ] [DEVICE LOG] 2019-11-19 19:32:08.887638+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2d0000 - WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network
process
[        ] [DEVICE LOG] 2019-11-19 19:32:08.887746+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a689bc0 - ProcessThrottler::didConnectToProcess(41544)
[        ] [DEVICE LOG] 2019-11-19 19:32:08.887781+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7330 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41544, name 'Web
content visibility'
[ +249 ms] [DEVICE LOG] 2019-11-19 19:32:09.139014+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41542, name
'ConnectionTerminationWatchdog'
[        ] [DEVICE LOG] 2019-11-19 19:32:09.139257+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f72d0 - ~ProcessAssertion() Releasing process assertion
[        ] [DEVICE LOG] 2019-11-19 19:32:09.140266+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a43b130 - NetworkProcessProxy is releasing a background assertion because the Network process is
done deleting Website data
[ +472 ms] [DEVICE LOG] 2019-11-19 19:32:09.612788+0200  localhost Runner[41473]: (RunningBoardServices) Created Activity ID: 0x9a1cac, Description: assertionsDidInvalidate
[        ] [DEVICE LOG] 2019-11-19 19:32:09.613477+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion() Process assertion for process with PID 41542 was invalidated
[        ] [DEVICE LOG] 2019-11-19 19:32:09.613559+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion::processAssertionWasInvalidated()
[   +7 ms] [DEVICE LOG] 2019-11-19 19:32:09.620989+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Process] Created visibility propagation view 0x7fbf0a683c90 for WebContent process with PID 41543
[  +22 ms] [DEVICE LOG] 2019-11-19 19:32:09.643655+0200  localhost Runner[41473]: (CoreFoundation) Created Activity ID: 0x9a1cad, Description: Loading Preferences From System CFPrefsD
[   +1 ms] [DEVICE LOG] 2019-11-19 19:32:09.644600+0200  localhost Runner[41473]: (AppSSOCore) [com.apple.AppSSO:SOConfigurationClient] -[SOConfigurationClient init]  on <SOConfigurationClient: 0x6000022e0900>
[        ] [DEVICE LOG] 2019-11-19 19:32:09.644808+0200  localhost Runner[41473]: (AppSSOCore) [com.apple.AppSSO:SOServiceConnection] <SOServiceConnection: 0x6000022e08e0>: new XPC connection
[   +2 ms] [DEVICE LOG] 2019-11-19 19:32:09.648162+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x7fbf0b199020 - WebPageProxy::decidePolicyForNavigationAction: keep using process 41543 for navigation,
reason: Process has not yet committed any provisional loads
[   +7 ms] [DEVICE LOG] 2019-11-19 19:32:09.655784+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didStartProvisionalLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[  +85 ms] [DEVICE LOG] 2019-11-19 19:32:09.741085+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] UIProcess is taking a background assertion because the WebContent process is holding locked files
[  +76 ms] [DEVICE LOG] 2019-11-19 19:32:09.816186+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didNavigateWithNavigationDataShared: webPID = 41543, pageID = 8
[        ] [DEVICE LOG] 2019-11-19 19:32:09.816452+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didCommitLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[ +139 ms] [DEVICE LOG] 2019-11-19 19:32:09.957310+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didFinishDocumentLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[  +21 ms] [DEVICE LOG] 2019-11-19 19:32:09.978038+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didFinishLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[        ] [DEVICE LOG] 2019-11-19 19:32:09.978097+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2e94e0 - NavigationState will release its process network assertion soon because the page load
completed
[+3002 ms] [DEVICE LOG] 2019-11-19 19:32:12.979149+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2e94e0 NavigationState is releasing background process assertion because a page load completed
[+1760 ms] [DEVICE LOG] 2019-11-19 19:32:14.741773+0200  localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] UIProcess is releasing a background assertion because the WebContent process is no longer holding
locked files

[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-EG)
    • Flutter version 1.9.1+hotfix.6 at /Users/osamafelfel/work/flutter
    • Framework revision 68587a0916 (10 weeks ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/osamafelfel/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 23.2.1
    • Dart plugin version 171.4424
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 41.1.4
    • Dart plugin version 192.7402

[✓] VS Code (version 1.38.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.2.0

[✓] Connected device (2 available)
    • AOSP on IA Emulator • emulator-5554                        • android-x86 • Android 9 (API 28) (emulator)
    • iPhone 11 Pro Max   • 1CCE1C63-DFC2-46B6-90B3-40AA32573E54 • ios         • com.apple.CoreSimulator.SimRuntime.iOS-13-2 (simulator)

• No issues found!

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用提供的 _openWebView 示例和 WebviewScaffold 在 iOS 和 Android 上重现延迟,并将导航动画与随附的录制进行比较。调查插件的 WebviewScaffold 导航和初始渲染行为;当 body 和 app bar 一起执行动画且没有报告中的延迟时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

领域
mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
32/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。