Skip to content

Flutter WebView - Hybrid Composition Crashes the App #67213

@tal412

Description

@tal412

Steps to Reproduce

  1. Open WebView and enable hybrid composition using: WebView.platform = SurfaceAndroidWebView() (When disabled - the bug doesn't occur)
  2. Go back to the previous page where you came from
  3. Try to rotate the page to landscape mode

Expected results:
The screen rotating normally.

Actual results:
The app crashed.

Logs
[+3933 ms] I/WebViewFactory(11251): Loading com.google.android.webview version 85.0.4183.101 (code 418310183)
[  +70 ms] I/cr_LibraryLoader(11251): Loaded native library version number "85.0.4183.101"
[        ] I/cr_CachingUmaRecorder(11251): Flushed 5 samples from 5 histograms.
[  +57 ms] W/chromium(11251): [WARNING:dns_config_service_posix.cc(342)] Failed to read DnsConfig.
[  +61 ms] W/om.webview_tes(11251): Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
[   +2 ms] W/cr_media(11251): Requires BLUETOOTH permission
[  +61 ms] E/libEGL  (11251): call to OpenGL ES API with no current context (logged once per thread)
[   +2 ms] W/Gralloc3(11251): allocator 3.x is not supported
[ +889 ms] D/OnePlusJankManager(11251):  Chor uploadMDM JANK_TYPE_ONCE mViewTitle = com.webview_test/com.webview_test.MainActivity--- jank level = 1
[+2909 ms] E/flutter (11251): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.RuntimeException: Methods marked with @UiThread must be
executed on the main thread. Current thread: 1.raster
[        ] E/flutter (11251):   at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:992)
[        ] E/flutter (11251):   at io.flutter.embedding.engine.FlutterJNI.destroyOverlaySurfaces(FlutterJNI.java:873)
[        ] E/flutter (11251): 
[        ] F/flutter (11251): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1286)] Check failed: CheckException(env). 
[ +255 ms] F/libc    (11251): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 11361 (1.raster), pid 11251 (om.webview_test)
[ +221 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[        ] Build fingerprint: 'OnePlus/OnePlus7Pro_EEA/OnePlus7Pro:10/QKQ1.190716.003/2007240000:user/release-keys'
[        ] Revision: '0'
[        ] ABI: 'arm64'
[        ] Timestamp: 2020-10-03 13:35:54+0300
[        ] pid: 11251, tid: 11361, name: 1.raster  >>> com.webview_test <<<
[        ] uid: 10762
[        ] signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
[        ] Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1286)] Check failed: CheckException(env). 
[        ] '
[        ]     x0  0000000000000000  x1  0000000000002c61  x2  0000000000000006  x3  000000751aa8d490
[        ]     x4  0000000000008000  x5  0000000000008000  x6  0000000000008000  x7  0080000000000000
[        ]     x8  00000000000000f0  x9  7eaf89dcede28044  x10 0000000000000001  x11 0000000000000000
[        ]     x12 fffffff0fffffbdf  x13 0000000000000003  x14 0000000000000001  x15 0000b3cba0e98417
[        ]     x16 000000760e228738  x17 000000760e206be0  x18 0000007516572000  x19 0000000000002bf3
[        ]     x20 0000000000002c61  x21 00000000ffffffff  x22 0000000000000568  x23 000000751fc63a80
[        ]     x24 0000000000000041  x25 000000751aa8e020  x26 0000000000000000  x27 0000000000000041
[        ]     x28 0000000000000001  x29 000000751aa8d530
[        ]     sp  000000751aa8d470  lr  000000760e1b8404  pc  000000760e1b8430
[  +64 ms] backtrace:
[        ]       #00 pc 0000000000073430  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: a2584ee8458a61d422edf24b4cd23b78)
[        ]       #01 pc 0000000001286f44  /data/app/com.webview_test-FPKpAVtYdfmSs-YNkW1NDQ==/lib/arm64/libflutter.so (BuildId: 0c638458ff559f7abd5975412f6d530104a696e1)
[        ]       #02 pc 00000000000024fc  [anon:.bss]
[ +305 ms] Service protocol connection closed.
[   +1 ms] Lost connection to device.

Analyzing webview_test...                                               
No issues found! (ran in 2.6s)
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.6 19G2021, locale en-IL)
    • Flutter version 1.22.0 at /Users/talbarda/Desktop/flutter
    • Framework revision d408d302e2 (4 days ago), 2020-09-29 11:49:17 -0700
    • Engine revision 5babba6c4d
    • Dart version 2.10.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/talbarda/Library/Android/sdk
    • Platform android-30, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
    • GM1913 (mobile) • d355cf87 • android-arm64 • Android 10 (API 29)

• No issues found!

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consolefound in release: 1.23Found to occur in 1.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions