AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Document how to update the Chrome web view in the Android emulator

Open danroth27 opened this issue 3 years ago โ€ข 10 comments

.NET MAUI Blazor apps require an updated Chrome web view to function properly. If a user tests with an older Android version, they will need to make sure that Chrome has been updated. We should provide some documentation on how to do this with the Android emulator. Otherwise, .NET MAUI Blazor apps won't work and users will get frustrated. Example: https://github.com/dotnet/maui/issues/7840.

@MackinnonBuck Can you help out with providing content on how to do this?

danroth27 avatar Jun 08 '22 16:06 danroth27

Is this for the following area? ...

https://docs.microsoft.com/en-us/aspnet/core/blazor/hybrid/security/security-considerations?view=aspnetcore-6.0#keep-the-web-view-current-in-deployed-apps

... and it seems like that section could be moved to the upcoming Publish and deploy overview article (https://github.com/dotnet/AspNetCore.Docs/issues/25683).

guardrex avatar Jun 08 '22 21:06 guardrex

No, this is a different. It's more related to testing and development than security. If you want to test your .NET MAUI Blazor app in the Android emulator using older Android versions, you'll likely need to manually update Chrome in the emulator image. Otherwise, .NET MAUI Blazor just won't work because the web view won't support the web platform features we need.

danroth27 avatar Jun 08 '22 21:06 danroth27

Hi, Is there any progress? we still have the same problem and unable to update internal webview on devices. For this reason maui still stays on the white screen and gives the same error. Internal unupdatable webview on device:

image

we can't solve the problem in maui or in webview, we are waiting for your help @danroth27 @guardrex

https://github.com/dotnet/maui/issues/7840

kbrkiras avatar Jun 23 '22 11:06 kbrkiras

@fkozaslan ... Dan is OOF right now.

@MackinnonBuck ... Any update on this, or are there any steps posted anywhere that would tide @fkozaslan over until we place guidance in the docs?

guardrex avatar Jun 23 '22 11:06 guardrex

@guardrex This is on my radar; I will try to get it done by the end of the month.

In the meantime, @fkozaslan, could you see if this StackOverflow answer helps in your case?

MackinnonBuck avatar Jun 23 '22 16:06 MackinnonBuck

@MackinnonBuck our problem is not in emulator on real device. Therefore, this solution does not fit, unfortunately.

kbrkiras avatar Jun 24 '22 07:06 kbrkiras

@fkozaslan ... In that case, we won't be able to address it further here. This issue only pertains to how to update the Chrome web view in the Android emulator, and this issue only pertains to documentation. It looks like to me ๐Ÿฆ– that you found a real ๐Ÿž of some sort.

@MackinnonBuck ... I don't understand why Javier closed @fkozaslan's original issue at https://github.com/dotnet/maui/issues/7840. The issue indicates that @fkozaslan isn't using the emulator and that the version of Chrome (whatever it is) for 7.1.1 should be sufficient per https://docs.microsoft.com/dotnet/maui/supported-platforms. The cross-linked error messages at https://github.com/dotnet/aspnetcore/issues/39086#issuecomment-995700125 have a similar flavor to @fkozaslan's error messages (JS API ๐Ÿ’ฅ of some sort in blazor.webview.js). It seems like @fkozaslan original issue should be re-opened for further investigation.

guardrex avatar Jun 24 '22 10:06 guardrex

@guardrex On Android, the OS version and the system WebView version are decoupled. In @fkozaslan's case, even though Android 7.1.1 is officially supported, MAUI Blazor requires a WebView newer than the one that came preinstalled on the device. Since Google Play Services is not installed on their device (afaict), updating the WebView is nontrivial at best. While unfortunate, I wouldn't say this is a bug on our end.

With that said, I'd like to ask for some clarification on the desired scope of this issue. I'm guessing that the "out of scope" content would be:

  • Updating the WebView for Android versions unsupported by MAUI Blazor (API 23 and below)
  • Updating the WebView on physical Android devices (notably those without Google Play Services installed)

And if this is the case, I believe our guidance could be as simple as:

  1. Use an emulator with Google Play Services preinstalled
  2. Follow the steps for downloading/updating Chrome from the Play Store

The weird tricks with side loading packages only apply to emulator versions where preinstalling Google Play Services is not an option (API 23 and below, which are not officially supported by MAUI Blazor anyway).

Does my proposed guidance sound sufficient? If not, which of the aforementioned "out of scope" scenarios should we provide guidance for?

@danroth27

MackinnonBuck avatar Jun 27 '22 18:06 MackinnonBuck

Thanks @MackinnonBuck ... That all sounds good to me and clears up my misunderstanding.

We'll keep this issue focused on emulator scenarios and leave our physical devices coverage as it stands unless there's a desire to change something. https://docs.microsoft.com/aspnet/core/blazor/hybrid/security/security-considerations#android

I'm OOF most of this week and only here on Friday. When we get back after ๐ŸŽ† July 4๐Ÿงจ and with any additional info that comes in from @danroth27, I'll probably have the PR up on July 5-ish. I'll ping u on the PR.

guardrex avatar Jun 27 '22 18:06 guardrex

@fkozaslan I believe you normally update the Android System WebView through the Google Play store: https://play.google.com/store/apps/details?id=com.google.android.webview&hl=en_US&gl=US. Does your device not have the Google Play services installed?

danroth27 avatar Jul 06 '22 23:07 danroth27

Emulators for older Android devices usually don't have Google Play Store installed; therefore, a manual installation is needed (e.g. via adb)

stradicat avatar Nov 30 '22 00:11 stradicat

We handed problem with install manually upgrade service, Thank you for replies

kbrkiras avatar Dec 18 '22 12:12 kbrkiras

@BethMassi ... I think I can put a PR up for this per Mackinnon's and Dan's remarks :point_up:.

I think the idea was to place a few remarks in the Android section at ...

https://learn.microsoft.com/aspnet/core/blazor/hybrid/security/security-considerations#android

Ultimately, the layout of content is likely to change. We can start by surfacing the content there just to get this issue out of the way. Later, things can move around.

Shall I proceed to put up a PR for this?

guardrex avatar Jul 20 '23 15:07 guardrex

Sounds good.

BethMassi avatar Jul 20 '23 16:07 BethMassi