dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.03k stars 1.73k forks source link

BlazorWebView CSS is only applied to Windows app but not Android #5750

Closed sturlath closed 1 year ago

sturlath commented 2 years ago

Description

I have this code base (file new project today from 17.2.0 preview 2.1 on Windows) where I added some CSS to try out and it works fine when run on Windows Machine but not if I try it out on a Android device

Looks good on Windows image

But this is how it looks on my Android device (Samsung Galaxy S7 (SM-G930F)) image

Steps to Reproduce

Try out my code on an Android device.

Version with bug

Preview 14 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 8.0.0 (API 26)

Did you find any workaround?

No response

Relevant log output

No response

jfversluis commented 2 years ago

Thanks for the report and linking your code, however either your repo doesn't exist or it's set to private :)

sturlath commented 2 years ago

Sorry @jfversluis it was private 🙈 you should now be able to view it.

kristinx0211 commented 2 years ago

verified repro with 17.2.0 Preview 2.1.

janseris commented 2 years ago

Reproduced CSS not working on Android 11, VS 2022 Professional 2022 (64-bit) - 17.2.0 Preview 2.1

And moreover - Android 5 gives this error: Java.Lang.NoSuchMethodError: 'no non-static method "Landroid/webkit/WebView;.createWebMessageChannel()[Landroid/webkit/WebMessagePort;"' (seems like runtime error)

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiapp1/crc64e632a077a20c694c.MainActivity" Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiapp1/crc64e632a077a20c694c.MainActivity }

Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/MauiApp1.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Mono.Android.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Java.Interop.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Collections.dll [External] Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:124 [0x00000]. Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Threading.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.InteropServices.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Threading.Thread.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Diagnostics.StackTrace.dll [External] Loaded assembly: data-0x7f605c1d5000 [External] Loaded assembly: data-0x7f605c1e6000 [External] Loaded assembly: data-0x7f605bf02000 [External] Loaded assembly: data-0x7f605bf52000 [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/netstandard.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Linq.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Collections.Concurrent.dll [External] Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:415 [0x00000]. Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Text.Json.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Text.Encodings.Web.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.ComponentModel.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Controls.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.ObjectModel.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Graphics.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Essentials.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Logging.Abstractions.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.Loader.dll [External] Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:410 [0x00000]. Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Memory.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Reflection.Emit.Lightweight.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Reflection.Emit.ILGeneration.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Reflection.Primitives.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.CompilerServices.Unsafe.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Core.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.AspNetCore.Components.WebView.Maui.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Controls.Compatibility.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Configuration.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Configuration.Abstractions.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Logging.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.AspNetCore.Components.WebView.dll [External] [art] Not late-enabling -Xcheck:jni (already on) [debug-app-helper] Checking if libmonodroid was unpacked to /data/app/com.companyname.mauiapp1-1/lib/x86_64/libmonodroid.so [debug-app-helper] Native libs extracted to /data/app/com.companyname.mauiapp1-1/lib/x86_64, assuming application/android:extractNativeLibs == true [debug-app-helper] Setting up for DSO lookup in app data directories [debug-app-helper] Added filesystem DSO lookup location: /data/app/com.companyname.mauiapp1-1/lib/x86_64 [debug-app-helper] Using runtime path: /data/app/com.companyname.mauiapp1-1/lib/x86_64 [debug-app-helper] checking directory: /data/data/com.companyname.mauiapp1/files/.__override__/lib [debug-app-helper] directory does not exist: /data/data/com.companyname.mauiapp1/files/.__override__/lib [debug-app-helper] Checking whether Mono runtime exists at: /data/data/com.companyname.mauiapp1/files/.override/libmonosgen-2.0.so [debug-app-helper] Checking whether Mono runtime exists at: /data/app/com.companyname.mauiapp1-1/lib/x86_64/libmonosgen-2.0.so [debug-app-helper] Mono runtime found at: /data/app/com.companyname.mauiapp1-1/lib/x86_64/libmonosgen-2.0.so [art] Attempt to remove local handle scope entry from IRT, ignoring [DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c [DOTNET] GetOptionalMethod: optional method setApplicationProtocols ([Ljava/lang/String;)V was not found [DOTNET] GetOptionalMethod: optional method getRevocationChecker ()Ljava/security/cert/CertPathChecker; was not found [DOTNET] GetOptionalMethod: optional method getReason ()Ljava/security/cert/CertPathValidatorException$Reason; was not found [DOTNET] GetOptionalClassGRef: optional class java/security/cert/CertPathValidatorException$BasicReason was not found [DOTNET] GetOptionalClassGRef: optional class java/security/cert/PKIXReason was not found [DOTNET] GetOptionalClassGRef: optional class javax/net/ssl/SNIHostName was not found [DOTNET] GetOptionalMethod: optional method getApplicationProtocol ()Ljava/lang/String; was not found [monodroid] Creating public update directory: /data/data/com.companyname.mauiapp1/files/.__override__ [art] Attempt to remove local handle scope entry from IRT, ignoring [monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:54404,embedding=1 [monodroid-assembly] open_from_bundles: failed to load assembly MauiApp1.dll [monodroid-gc] GREF GC Threshold: 46080 [monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll [monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.Thread.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.StackTrace.dll [art] Attempt to remove local handle scope entry from IRT, ignoring [monodroid-assembly] open_from_bundles: failed to load assembly netstandard.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Concurrent.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encodings.Web.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.ObjectModel.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Graphics.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Essentials.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.Abstractions.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Loader.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.Lightweight.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.ILGeneration.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Primitives.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.CompilerServices.Unsafe.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.Abstractions.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.WebView.Maui.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.Abstractions.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.WebView.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Primitives.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Primitives.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Xaml.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Controls.Xaml.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.AppCompat.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Google.Android.Material.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.AppCompat.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.Google.Android.Material.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.ComponentModel.TypeConverter.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Uri.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Private.Uri.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.DrawerLayout.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CustomView.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Navigation.Runtime.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.DrawerLayout.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.CustomView.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Navigation.Runtime.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.JSInterop.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.JSInterop.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.AspNetCore.Components.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Options.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.Options.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.DependencyInjection.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.Tracing.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Diagnostics.Tracing.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Expressions.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Linq.Expressions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.ReaderWriter.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Xml.ReaderWriter.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Private.Xml.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encoding.Extensions.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Text.Encoding.Extensions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Text.RegularExpressions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Numerics.Vectors.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.Web.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Abstractions.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.AspNetCore.Components.Web.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.FileProviders.Abstractions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SwipeRefreshLayout.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CardView.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.RecyclerView.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.SwipeRefreshLayout.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.CardView.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.RecyclerView.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.ViewPager.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Fragment.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Activity.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Common.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.ViewModel.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SavedState.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Activity.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Lifecycle.Common.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.SavedState.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Loader.dll [External] [art] Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable Thread started: #2 Thread started: #3 Thread started: #4 [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Json.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Private.DataContractSerialization.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Xml.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.Serialization.Json.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Private.DataContractSerialization.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.Serialization.Xml.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Runtime.Serialization.Primitives.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.CoordinatorLayout.dll [External] [WebViewFactory] Loading com.android.webview version 37 (6695550-x86_64) (code 100008) [LibraryLoader] Loading: webviewchromium [LibraryLoader] Time to load native libraries: 3 ms (timestamps 5791-5794) [LibraryLoader] Expected native library version number "",actual native library version number "" [WebViewChromiumFactoryProvider] Binding Chromium to main looper Looper (main, tid 1) {2b22f042} [LibraryLoader] Expected native library version number "",actual native library version number "" [chromium] [INFO:library_loader_hooks.cc(106)] Chromium logging enabled: level = 0, default verbosity = 0 [BrowserStartupController] Initializing chromium process, renderers=0 [art] Attempt to remove local handle scope entry from IRT, ignoring [chromium] [WARNING:resource_bundle.cc(315)] locale_file_path.empty() [chromium] [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=34 off=46092 len=2953 [chromium] [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:35 off:228796 len:643667 [AudioManagerAndroid] Requires BLUETOOTH permission [] HostConnection::get() New Host Connection established 0x7f6058ff6fd0, tid 8833 [EGL_emulation] eglCreateContext: 0x7f6058bf3e80: maj 2 min 0 rcv 2 [EGL_emulation] eglMakeCurrent: 0x7f6058bf3e80: ver 2 0 (tinfo 0x7f60589ffb00) [chromium] [WARNING:proxy_service.cc(901)] PAC support disabled because there is no system implementation [chromium] [WARNING:data_reduction_proxy_settings.cc(403)] SPDY proxy OFF at startup [art] Attempt to remove local handle scope entry from IRT, ignoring [AwContents] onDetachedFromWindow called when already detached. Ignoring [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Embedded.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.FileProviders.Embedded.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Composite.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Microsoft.Extensions.FileProviders.Composite.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.XDocument.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.Linq.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Xml.XDocument.dll [External] Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/System.Private.Xml.Linq.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll Loaded assembly: /data/data/com.companyname.mauiapp1/files/.override/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External] [OpenGLRenderer] Render dirty regions requested: true [Atlas] Validating map... Thread started: .NET Timers #5 [OpenGLRenderer] Initialized EGL, version 1.4 [] HostConnection::get() New Host Connection established 0x7f6056a07200, tid 8892 [OpenGLRenderer] Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... [EGL_emulation] eglCreateContext: 0x7f606dcca200: maj 2 min 0 rcv 2 [EGL_emulation] eglMakeCurrent: 0x7f606dcca200: ver 2 0 (tinfo 0x7f606dc48ac0) [OpenGLRenderer] Enabling debug mode 0 [EGL_emulation] eglMakeCurrent: 0x7f606dcca200: ver 2 0 (tinfo 0x7f606dc48ac0) Thread started: #6 [eglCodecCommon] glUtilsParamSize: unknow param 0x000085b5 Thread started: #7 [eglCodecCommon] glUtilsParamSize: unknow param 0x000085b5 Thread started: #8 Thread started: #9 [chromium] [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token )", source: https://0.0.0.0/_framework/blazor.webview.js (1) [eglCodecCommon] glUtilsParamSize: unknow param 0x000085b5 [chromium] [INFO:CONSOLE(29)] "Uncaught TypeError: Cannot set property 'sendMessage' of undefined", source: (29) [eglCodecCommon] glUtilsParamSize: unknow param 0x000085b5 Java.Lang.NoSuchMethodError: 'no non-static method "Landroid/webkit/WebView;.createWebMessageChannel()[Landroid/webkit/WebMessagePort;"'

Thread started: #10 The vm is not suspended. Mono.Debugger.Soft.VMNotSuspendedException: The vm is not suspended. at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args) in D:\a_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\VirtualMachine.cs:line 369 at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet) in D:\a_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\Connection.cs:line 1812 at Mono.Debugger.Soft.VirtualMachine.Resume() in D:\a_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\VirtualMachine.cs:line 139 at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es) in D:\a_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1888 at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in D:\a_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1786

SteveSandersonMS commented 2 years ago

@sturlath Thanks for the report. To narrow this down, could you please try the following?

ghost commented 2 years ago

Hi @sturlath. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

sturlath commented 2 years ago

I works on a Nexus 10 - API 30 emulator I had (so I guess it should work on others) image

I´ll try to create a new project (with same CSS/HTLM) and see how that looks on the phone (I´m guessing you are interested in that right?). I´m sure I can manage to find it out in the next few days. Any change you could point me to a example repo that I could then plug my CSS/HTLM in?

janseris commented 2 years ago

When built for Pixel 5 API 30 (Android 11) in Debug configuration, it cannot be installed on my real Sony Xperia 5 with Android 11. Microsoft Visual Studio Professional 2022 (64-bit) - Preview Version 17.2.0 Preview 2.1 Microsoft.Android.Sdk.Windows\31.0.200-preview.14.106

Signed APK shows "application cannot be installed" after attempting instalation. Unsigned APK shows "error during package analysis" when opening the apk. The Debug APKs: https://easyupload.io/m/566loe

When built with Release config, the CSS still does not work and only 1 apk is produced - the signed one. This one can be installed on Sony Xperia 5 real device with Android 11. The Release signed apk link: https://easyupload.io/53ysfj Screenshot from Sony Xperia 5 - CSS doesn't work and moreover - static images don't work! 277368548_491255532644357_5383911954312229865_n

This Release build when run on Pixel 5 API 30 in Visual Studio, produces the following error but works:

[System] Uncaught exception thrown by finalizer
[System] java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles.
[System]    at UM.finalize(chromium-TrichromeWebViewGoogle.apk-stable-410410686:4)
[System]    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)
[System]    at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)
[System]    at java.lang.Daemons$Daemon.run(Daemons.java:139)
[System]    at java.lang.Thread.run(Thread.java:923)
[System] Caused by: java.lang.Exception: AutocloseableRouter allocated at:
[System]    at UM.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:7)
[System]    at EP.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:6)
[System]    at org.chromium.content.browser.framehost.RenderFrameHostImpl.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:10)
[System]    at org.chromium.content.browser.framehost.RenderFrameHostImpl.create(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at J.N.MjidYpBx(Native Method)
[System]    at org.chromium.content.browser.webcontents.WebContentsImpl.r0(chromium-TrichromeWebViewGoogle.apk-stable-410410686:3)
[System]    at K7.g(chromium-TrichromeWebViewGoogle.apk-stable-410410686:5)
[System]    at com.android.webview.chromium.WebViewChromium.postMessageToMainFrame(chromium-TrichromeWebViewGoogle.apk-stable-410410686:4)
[System]    at android.webkit.WebView.postWebMessage(WebView.java:1971)
[System]    at crc64d693e2d9159537db.WebKitWebViewClient_JavaScriptValueCallback.n_onReceiveValue(Native Method)
[System]    at crc64d693e2d9159537db.WebKitWebViewClient_JavaScriptValueCallback.onReceiveValue(WebKitWebViewClient_JavaScriptValueCallback.java:30)
[System]    at X6.a(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at org.chromium.android_webview.AwContents.w(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at xr.run(Unknown Source:4)
[System]    at android.os.MessageQueue.nativePollOnce(Native Method)
[System]    at android.os.MessageQueue.next(MessageQueue.java:335)
[System]    at android.os.Looper.loop(Looper.java:183)
[System]    at android.app.ActivityThread.main(ActivityThread.java:7656)
[System]    at java.lang.reflect.Method.invoke(Native Method)
[System]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[System]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
janseris commented 2 years ago

Microsoft Visual Studio Professional 2022 (64-bit) - Preview Version 17.2.0 Preview 2.1

Microsoft.Android.Sdk.Windows\31.0.200-preview.14.106

Running the application on Nexus 10emulator Release build yields the following result:

This Release config signed APK: https://easyupload.io/ygcfjg

The Sony Xperia 5 real device result is the same - images and CSS broken but the apk works.

image

[System] Uncaught exception thrown by finalizer
[System] java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles.
[System]    at UM.finalize(chromium-TrichromeWebViewGoogle.apk-stable-410410686:4)
[System]    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)
[System]    at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)
[System]    at java.lang.Daemons$Daemon.run(Daemons.java:139)
[System]    at java.lang.Thread.run(Thread.java:923)
[System] Caused by: java.lang.Exception: AutocloseableRouter allocated at:
[System]    at UM.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:7)
[System]    at EP.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:6)
[System]    at org.chromium.content.browser.framehost.RenderFrameHostImpl.<init>(chromium-TrichromeWebViewGoogle.apk-stable-410410686:10)
[System]    at org.chromium.content.browser.framehost.RenderFrameHostImpl.create(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at J.N.MjidYpBx(Native Method)
[System]    at org.chromium.content.browser.webcontents.WebContentsImpl.r0(chromium-TrichromeWebViewGoogle.apk-stable-410410686:3)
[System]    at K7.g(chromium-TrichromeWebViewGoogle.apk-stable-410410686:5)
[System]    at com.android.webview.chromium.WebViewChromium.postMessageToMainFrame(chromium-TrichromeWebViewGoogle.apk-stable-410410686:4)
[System]    at android.webkit.WebView.postWebMessage(WebView.java:1971)
[System]    at crc64d693e2d9159537db.WebKitWebViewClient_JavaScriptValueCallback.n_onReceiveValue(Native Method)
[System]    at crc64d693e2d9159537db.WebKitWebViewClient_JavaScriptValueCallback.onReceiveValue(WebKitWebViewClient_JavaScriptValueCallback.java:30)
[System]    at X6.a(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at org.chromium.android_webview.AwContents.w(chromium-TrichromeWebViewGoogle.apk-stable-410410686:1)
[System]    at xr.run(Unknown Source:4)
[System]    at android.os.MessageQueue.nativePollOnce(Native Method)
[System]    at android.os.MessageQueue.next(MessageQueue.java:335)
[System]    at android.os.Looper.loop(Looper.java:183)
[System]    at android.app.ActivityThread.main(ActivityThread.java:7656)
[System]    at java.lang.reflect.Method.invoke(Native Method)
[System]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[System]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
SteveSandersonMS commented 2 years ago

Thanks everyone for commenting here.

We're getting a wide range of reports - some saying that there's a CSS problem, some that there's a problem with static images, some saying the apps don't even install, and others saying everything works fine.

In order for us to take action, we really need these different scenarios to be described in full detail so that we can try to reproduce them.

If you are able to reproduce one of the problems above, could you please file a new issue, and give full repro steps? This means providing the code that reproduces the issue as well as the deployment steps (e.g., to which device, and how it's being deployed).

ghost commented 2 years ago

Hi @sturlath. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

javiercn commented 2 years ago

I installed the apk on the emulator and it seems to be working as expected.

I would suggest to anyone running into this issue that they first check to make sure that the files are inside the generated APK as a first step and if that's not the case, examine the binlog from the publish output.

sturlath commented 2 years ago

So much going here and so little time (and knowledge og Maui og both the webviews).

If somebody can change the code using webview I can run it on my device else Im not sure I can find time to do this until next weekend (can test the code np). And if you like logs or something else just let me know what to send.

Sorry for not having more time atm..

janseris commented 2 years ago

Thanks everyone for commenting here.

We're getting a wide range of reports - some saying that there's a CSS problem, some that there's a problem with static images, some saying the apps don't even install, and others saying everything works fine.

In order for us to take action, we really need these different scenarios to be described in full detail so that we can try to reproduce them.

If you are able to reproduce one of the problems above, could you please file a new issue, and give full repro steps? This means providing the code that reproduces the issue as well as the deployment steps (e.g., to which device, and how it's being deployed).

I have provided all that info for my reports. Please, if any important part of the information which Is needed for reproducing is missing, let me know and I will try to add that.

Deployment = copy apk from VS build folder to device.

I will try to create separate tickets if I have time.

SteveSandersonMS commented 2 years ago

@janseris Looking at your three comments above (1, 2, 3), I can only see links to prebuilt APK files but not links to a GitHub repo containing the app source code, nor repro steps (in the sense of exactly what code to add to a default project and then what step-by-step actions you're taking to publish and deploy it). Did I miss something? Are you using the exact same code as https://github.com/sturlath/Maui, without any modifications?

If you can provide that additional info then we'd be in a better position to investigate.

janseris commented 2 years ago

@SteveSandersonMS Yes, right - I tried the exact code posted by the issue creator (sturlath) without any modifications. I opened it in Version 17.2.0 Preview 2.1 just as sturlath and tried to run it just as he did - Windows and Android but moreover I tried it on my Sony Xperia 5 device.

I have this code base

I just tried to reproduce this random issue as is because I have experienced strange MAUI behavior (unexpected build errors with Android) recently in my VS. I uploaded the apks just for reference. I don't know if it's important but I thought someone might want to compare the apk output when the visible result compared to sturlath result would not be the same - which happened to me and I thought that's kinda strange.

PureWeen commented 2 years ago

@SteveSandersonMS Yes, right - I tried the exact code posted by the issue creator (sturlath) without any modifications. I opened it in Version 17.2.0 Preview 2.1 just as sturlath and tried to run it just as he did - Windows and Android but moreover I tried it on my Sony Xperia 5 device.

I have this code base

I just tried to reproduce this random issue as is because I have experienced strange MAUI behavior (unexpected build errors with Android) recently in my VS. I uploaded the apks just for reference. I don't know if it's important but I thought someone might want to compare the apk output when the visible result compared to sturlath result would not be the same - which happened to me and I thought that's kinda strange.

@SteveSandersonMS do you need any additional info?

SteveSandersonMS commented 2 years ago

I thought this was something we looked into and confirmed was resolved before MAUI GA shipped. So I'm surprised the issue is still open. Maybe that's just an oversight on my part.

@TanayParikh Might this issue be a duplicate of something you looked into?

TanayParikh commented 2 years ago

@TanayParikh Might this issue be a duplicate of something you looked into?

I don't believe so. Though this may be related to https://github.com/dotnet/maui/issues/7468 that @MackinnonBuck was looking into.

@janseris can you please confirm if you're still running into this issue with MAUI GA?

javiercn commented 1 year ago

@TanayParikh giving this to you.

Feel free to close if no further action is needed, since we haven't heard back.

TanayParikh commented 1 year ago

Is anyone still experiencing this issue in 7.0 RC2?

ghost commented 1 year ago

Hi @sturlath. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.