You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not understanding what caused such behavior: marshaling or together with trimming or AOT. But Images are not displayed in release on android with AndroidEnableMarshalMethods is true.
public class ImgResExtension : IMarkupExtension
{
public string? Source { get; set; }
public object? ProvideValue(IServiceProvider serviceProvider)
{
if (Source == null)
return null;
var path = $"Maui9MarshalAndImageBug.Resources.Images.{Source}";
//return ImageSource.FromResource(path);
var assembly = Assembly.GetAssembly(typeof(App));
if (assembly is null)
return null;
var stream = assembly.GetManifestResourceStream(path);
if (stream is null)
return null;
return ImageSource.FromStream(() => stream);
}
}
This seems to be the reason that the image is not showing up:
02-19 08:30:42.570 27351 27351 W Glide : Load failed for [mono.android.runtime.InputStreamAdapter@3a55284] with dimensions [923x486]
02-19 08:30:42.570 27351 27351 W Glide : class com.bumptech.glide.load.engine.GlideException: Failed to load resource
02-19 08:30:42.570 27351 27351 W Glide : Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{InputStreamAdapter->Object->Drawable}, LOCAL
02-19 08:30:42.570 27351 27351 W Glide : Cause (1 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{InputStreamAdapter->Drawable->Drawable}
02-19 08:30:42.570 27351 27351 W Glide : Cause (2 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{InputStreamAdapter->GifDrawable->Drawable}
02-19 08:30:42.570 27351 27351 W Glide : Cause (3 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{InputStreamAdapter->Bitmap->BitmapDrawable}
02-19 08:30:42.570 27351 27351 W Glide : Cause (4 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{InputStreamAdapter->BitmapDrawable->Drawable}
02-19 08:30:42.578 27351 27351 W Glide : Load failed for [crc6488302ad6e9e4df1a.ImageLoaderCallback@8d46097] with dimensions [923x486]
02-19 08:30:42.578 27351 27351 W Glide : class com.bumptech.glide.load.engine.GlideException: Failed to load resource
It only happens in Release with <AndroidEnableMarshalMethods>true</AndroidEnableMarshalMethods>.
Description
I am not understanding what caused such behavior: marshaling or together with trimming or AOT. But Images are not displayed in release on android with AndroidEnableMarshalMethods is true.
<AndroidEnableMarshalMethods>true</AndroidEnableMarshalMethods>
Steps to Reproduce
see the repository
Link to public reproduction project repository
[email protected]:alex3696/Maui9MarshalAndImageBug.git
https://github.com/alex3696/Maui9MarshalAndImageBug.git
Version with bug
9.0.40 - no image
9.0.30 - app crash
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Android
Affected platform versions
tested on Andriod9 device and virtual Andriod14
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: