jonathanpeppers / glidex

glidex.forms is a library using Glide for faster Xamarin.Forms images on Android. Find out more about Glide at https://github.com/bumptech/glide
MIT License
195 stars 21 forks source link

Problems running Xamarin Forms Flyout Template #87

Open tolemac opened 3 years ago

tolemac commented 3 years ago

Steps to reproduce:

  1. Open Visual Studio
  2. Create new Proyect "Mobile App (Xamarin.Forms)
  3. Select Flyout template
  4. Right click on android project to select Properties
  5. Select Android 10.0 on application tab.
  6. On Android manifest tab select Android 10 as Target Android version.
  7. Add glidex.forms nuget package
  8. Add Android.Glide.Forms.Init(this); after Xamarin.Forms.Forms.Init
  9. Run application over emulator.

When application appear you can tap burger menu and it shows flyout but you can tap the options.

On the debug window I show this messages in repetitive loop (changing only the number of objects and other numbers):

12-01 21:38:34.120 I/ame.pruebaglid(22389): Explicit concurrent copying GC freed 2263(100KB) AllocSpace objects, 0(0B) LOS objects, 30% free, 13MB/19MB, paused 543us total 169.891ms
12-01 21:38:34.135 D/Mono    (22389): GC_TAR_BRIDGE bridges 337 objects 780273 opaque 282532 colors 337 colors-bridged 337 colors-visible 337 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.04ms tarjan 146.72ms scc-setup 0.04ms gather-xref 0.01ms xref-setup 0.01ms cleanup 14.18ms
12-01 21:38:34.135 D/Mono    (22389): GC_BRIDGE: Complete, was running for 186.34ms
12-01 21:38:34.135 D/Mono    (22389): GC_MINOR: (Nursery full) time 169.30ms, stw 170.33ms promoted 1662K major size: 89904K in use: 86941K los size: 8192K in use: 4536K

I am running it with "Pixel 2 Pie 9.0 - Api 28" emulator image.

What is wrong?

PD: When I comment Android.Glide.Forms.Init(this); and run app the problem still occurs, the problem go out only when I remove glidex.forms nuget package.

tolemac commented 3 years ago

When I activate debug (Android.Glide.Forms.Init(this, debug: true);) I obtain these messages in debug window:

12-01 22:33:54.061 I/ame.pruebaglid(23962): Explicit concurrent copying GC freed 2528(119KB) AllocSpace objects, 0(0B) LOS objects, 32% free, 12MB/18MB, paused 397us total 46.955ms
12-01 22:33:54.076 D/Mono    (23962): GC_TAR_BRIDGE bridges 340 objects 501218 opaque 185136 colors 340 colors-bridged 340 colors-visible 340 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.06ms tarjan 81.52ms scc-setup 0.04ms gather-xref 0.01ms xref-setup 0.01ms cleanup 14.11ms
12-01 22:33:54.076 D/Mono    (23962): GC_BRIDGE: Complete, was running for 62.74ms
12-01 22:33:54.076 D/Mono    (23962): GC_MINOR: (Nursery full) time 102.60ms, stw 103.44ms promoted 1663K major size: 85408K in use: 82573K los size: 10240K in use: 8084K
12-01 22:33:54.076 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.076 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.077 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.124 I/ame.pruebaglid(23962): Explicit concurrent copying GC freed 245(37KB) AllocSpace objects, 0(0B) LOS objects, 32% free, 12MB/18MB, paused 604us total 38.077ms
12-01 22:33:54.125 D/Mono    (23962): GC_TAR_BRIDGE bridges 4 objects 4 opaque 0 colors 4 colors-bridged 4 colors-visible 4 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.02ms tarjan 0.01ms scc-setup 0.01ms gather-xref 0.01ms xref-setup 0.01ms cleanup 0.01ms
12-01 22:33:54.125 D/Mono    (23962): GC_BRIDGE: Complete, was running for 38.92ms
12-01 22:33:54.125 D/Mono    (23962): GC_MINOR: (Concurrent start) time 5.87ms, stw 8.66ms promoted 8K major size: 85424K in use: 82583K los size: 10240K in use: 8084K
12-01 22:33:54.125 D/Mono    (23962): GC_MAJOR_CONCURRENT_START: (LOS overflow)
12-01 22:33:54.212 I/ame.pruebaglid(23962): Explicit concurrent copying GC freed 97(24KB) AllocSpace objects, 0(0B) LOS objects, 32% free, 12MB/18MB, paused 312us total 35.987ms
12-01 22:33:54.286 D/Mono    (23962): GC_TAR_BRIDGE bridges 10679 objects 13124 opaque 1 colors 10679 colors-bridged 10679 colors-visible 10679 xref 4 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.78ms tarjan 2.84ms scc-setup 0.97ms gather-xref 0.14ms xref-setup 0.05ms cleanup 0.71ms
12-01 22:33:54.286 D/Mono    (23962): GC_BRIDGE: Complete, was running for 119.49ms
12-01 22:33:54.286 D/Mono    (23962): GC_MAJOR_CONCURRENT_FINISH: (finishing) time 81.81ms, stw 31.04ms los size: 8192K in use: 1645K
12-01 22:33:54.286 D/Mono    (23962): GC_MAJOR_SWEEP: major size: 85104K in use: 81881K
12-01 22:33:54.317 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.317 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.318 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.327 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.327 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.327 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.349 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.349 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.350 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.360 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.360 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.361 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.386 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.386 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.387 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.395 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.395 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.395 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.423 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.424 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.424 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.435 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.435 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.436 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.483 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.483 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.483 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.493 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.493 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.494 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.533 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.533 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.534 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.543 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.543 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.543 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.589 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.589 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.589 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.599 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.599 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.599 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.640 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.640 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.641 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.652 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.653 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.653 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.813 I/ame.pruebaglid(23962): Explicit concurrent copying GC freed 2326(97KB) AllocSpace objects, 0(0B) LOS objects, 31% free, 12MB/18MB, paused 385us total 39.424ms
12-01 22:33:54.822 D/Mono    (23962): GC_TAR_BRIDGE bridges 341 objects 511580 opaque 188559 colors 341 colors-bridged 341 colors-visible 341 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.05ms tarjan 78.98ms scc-setup 0.04ms gather-xref 0.01ms xref-setup 0.01ms cleanup 8.18ms
12-01 22:33:54.822 D/Mono    (23962): GC_BRIDGE: Complete, was running for 49.34ms
12-01 22:33:54.822 D/Mono    (23962): GC_MINOR: (Nursery full) time 96.94ms, stw 98.09ms promoted 1663K major size: 86688K in use: 83601K los size: 8192K in use: 2380K
12-01 22:33:54.823 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.823 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.823 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.831 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.831 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.832 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.854 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.854 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.854 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.863 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.863 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.863 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.912 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.912 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.912 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.923 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.923 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.923 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.967 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.967 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.967 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:54.976 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.976 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.976 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:54.997 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:54.998 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:54.998 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:55.007 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.007 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.007 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:55.056 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.056 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.057 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:55.066 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.066 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.067 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:55.108 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.108 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.109 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:55.118 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.118 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.118 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:55.141 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.142 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.142 D/glidex  (23962): Loading `icon_about.png` as an Android resource
12-01 22:33:55.153 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.153 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.154 D/glidex  (23962): Loading `icon_feed.png` as an Android resource
12-01 22:33:55.201 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, instance created.
12-01 22:33:55.201 D/glidex  (23962): IImageViewHandler of type `Android.Glide.ImageViewHandler`, `LoadImageAsync` called.
12-01 22:33:55.201 D/glidex  (23962): Loading `icon_about.png` as an Android resource
jonathanpeppers commented 3 years ago

Uh.... Xamarin.Forms appears to be calling into LoadImageAsync constantly!

image

I think there must be a Xamarin.Forms bug here, I'll see what happens if I put an empty IImageViewHandler in this project.

tolemac commented 3 years ago

Ok,

Can I do some assembly downgrade in order to solve this by the moment? as a workarround.

Thank you very much!

jonathanpeppers commented 3 years ago

Let me know if you can find an older Xamarin.Forms version where this bug isn't happening, thanks.

tolemac commented 3 years ago

Ok @jonathanpeppers I'm not hurry up!

At the moment I can continue without glide.

I will wait for your researching ;)

jonathanpeppers commented 3 years ago

@tolemac you might go like/comment on: https://github.com/xamarin/Xamarin.Forms/issues/13118