pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.15k stars 1.47k forks source link

webview only uses the front camera on android 6 #953

Open daraul opened 3 years ago

daraul commented 3 years ago

Environment

Technology Version
Flutter version Flutter 2.2.3
Plugin version ^5.3.2
Android version 6
iOS version -
Xcode version -

Device information:

android-arm64, running android 6.0. Don't have much to go on myself, the product page is here

Description

Expected behavior:

I open my url, it opens a stream of the back camera.

Current behavior:

It opens the front camera instead.

Stacktrace

An Observatory debugger and profiler on ALKAID is available at: http://127.0.0.1:35911/nRn5tSFWHxM=/
D/HwCust  ( 6096): Create obj success use class android.content.res.HwCustHwResourcesImpl
I/TdCust  ( 6096): Constructor found for class com.android.internal.policy.TdCustPhoneWindowImpl, args = [Ljava.lang.Object;@8aa5dad
D/TdCustPhoneWindow( 6096): TDLOG:TdCustPhoneWindowImpl init
D/TdCust  ( 6096): Create obj success use class com.android.internal.policy.TdCustPhoneWindowImpl
D/HwSensorManager( 6096): HwSensorManager version: 1.0.0
The Flutter DevTools debugger and profiler on ALKAID is available at: http://127.0.0.1:9105?uri=http%3A%2F%2F127.0.0.1%3A35911%2FnRn5tSFWHxM%3D%2F
I/cr_Ime  ( 6096): ImeThread is enabled.
W/cr_media( 6096): Requires BLUETOOTH permission
D/TdCustPhoneWindow( 6096): TDLOG:generateLayoutWithSoftKey hasSoftkey is:false
E/libEGL  ( 6096): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
E/chromium( 6096): [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
D/mali_winsys( 6096): new_window_surface returns 0x3000
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
W/VideoCapabilities( 6096): Unsupported profile 64 for video/avc
I/VideoCapabilities( 6096): Unsupported profile 16384 for video/mp4v-es
I/VideoCapabilities( 6096): Unsupported profile 16384 for video/mp4v-es
W/VideoCapabilities( 6096): Unsupported mime video/x-pn-realvideo
W/VideoCapabilities( 6096): Unsupported mime video/mpeg
W/VideoCapabilities( 6096): Unrecognized profile/level 0/0 for video/mpeg2
W/VideoCapabilities( 6096): Unrecognized profile/level 0/2 for video/mpeg2
W/VideoCapabilities( 6096): Unrecognized profile/level 0/3 for video/mpeg2
W/VideoCapabilities( 6096): Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities( 6096): Unsupported mime video/vc1
W/VideoCapabilities( 6096): Unsupported mime video/x-flv
W/VideoCapabilities( 6096): Unrecognized profile/level 0/0 for video/mpeg2
W/VideoCapabilities( 6096): Unrecognized profile/level 0/2 for video/mpeg2
W/VideoCapabilities( 6096): Unrecognized profile/level 0/3 for video/mpeg2
I/X509Util( 6096): Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
I/VideoCapabilities( 6096): Unsupported profile 4 for video/mp4v-es
I/flutter ( 6096): {protectionSpace: {host: 10.9.0.146, protocol: https, realm: null, port: -1, sslCertificate: {issuedBy: {CName: daraul.com, DName: CN=daraul.com,C=GY,O=Daraul Harris, OName: Daraul Harris, UName: }, issuedTo: {CName: vidc.localhost, DName: CN=vidc.localhost,C=GY,O=Daraul Harris, OName: Daraul Harris, UName: }, validNotAfterDate: 1701019830000, validNotBeforeDate: 1629739830000, x509Certificate: {basicConstraints: {isCA: false, pathLenConstraint: null}, subjectAlternativeNames: [vidc.localhost], issuerAlternativeNames: [], extendedKeyUsage: [], issuerDistinguishedName: CN=daraul.com, O=Daraul Harris, C=GY, keyUsage: [true, true, true, true, false, false, false, false], notAfter: 2023-11-26 17:30:30.000Z, notBefore: 2021-08-23 17:30:30.000Z, serialNumber: [91, 214, 169, 54, 186, 13, 188, 13, 87, 247, 38, 210, 73, 49, 61, 26, 119, 214, 238, 75], sigAlgName: sha256WithRSAEncryption, sigAlgOID: 1.2.840.113549.1.1.11, sigAlgParams: null, signature: [60, 245, 69, 4, 158, 58, 208, 119, 224, 165, 139, 175, 19, 162, 4
W/cr_BindingManager( 6096): Cannot call determinedVisibility() - never saw a connection for the pid: 6096
I/CameraManagerGlobal( 6096): Connecting to camera service

Why file the bug here?

I don't know how you'd go about reproducing this. I know this is an incredibly niche situation. I've tested this on two other devices, both running android 7, and it opens the back camera as expected. I came here since it's the only place I can think of that the problem might reside. I may retry with the official webview plugin, but I use this one since I need to use a self signed certificate.

Just hoping you can point me in the right direction here.

Looks really similar to https://github.com/pichillilorenzo/flutter_inappwebview/issues/922, except my webview uses the front camera, instead of the back.

github-actions[bot] commented 3 years ago

👋 @daraul

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!