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
21.99k stars 1.72k forks source link

CollectionView inside a Grid, various problems #12584

Open acaliaro opened 1 year ago

acaliaro commented 1 year ago

Description

Hello. I need to use collectionviews within a grid. It seems that collectionviews when inside a grid don't work very well. For example, in the attached project I have this situation: in a 2*3 grid I have: 1- row 0 column 0, a collectionview inside a stacklayout. Instead of staying in the first cell, the collectionview occupies all the cells of the same column, and scrolling doesn't work 2- row 0 column 1, a collectionview with a griditemslayout, scrolling but slowly 3- row 1 column 1, a collectionview with a griditemslayout, inside a stacklayout: don't scroll 4- row 0 column 2, a collectionview that scrolls, but slowly

during scrolling, I see a lot of

[iappgridproble] Explicit concurrent copying GC freed 9457(570KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 5112KB/16MB, paused 79us total 34.070ms [iappgridproble] Explicit concurrent copying GC freed 312(39KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 5137KB/17MB, paused 40us total 27.919ms [iappgridproble] Explicit concurrent copying GC freed 306(39KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 5161KB/17MB, paused 40us total 27.764ms

Steps to Reproduce

There is a project linked

Link to public reproduction project repository

https://github.com/acaliaro/MauiAppGridProblem

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 10

Did you find any workaround?

No

Relevant log output

Inoltro della porta 8902 del debugger
Rilevamento del processo esistente
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiappgridproblem/crc64a5f410948c19c3fc.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiappgridproblem/crc64a5f410948c19c3fc.MainActivity }
[iappgridproble] Late-enabling -Xcheck:jni
[iappgridproble] Unknown bits set in runtime_flags: 0x8000
[iappgridproblem] type=1400 audit(0.0:76279): avc: denied { search } for name="/" dev="mmcblk0p37" ino=2 scontext=u:r:untrusted_app:s0:c232,c256,c512,c768 tcontext=u:object_r:factory_file:s0 tclass=dir permissive=0
[Perf] Connecting to perf service.
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/com.companyname.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/com.companyname.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64, 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.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64
[debug-app-helper] Using runtime path: /data/app/com.companyname.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64
[debug-app-helper] checking directory: `/data/user/0/com.companyname.mauiappgridproblem/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.companyname.mauiappgridproblem/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.mauiappgridproblem/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/com.companyname.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/com.companyname.mauiappgridproblem-74tEU_l678wHiSGv40-lxw==/lib/arm64/libmonosgen-2.0.so
[iappgridproble] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[monodroid] Creating public update directory: `/data/user/0/com.companyname.mauiappgridproblem/files/.__override__`
[iappgridproble] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8902,server=y,embedding=1
[iappgridproblem] type=1400 audit(0.0:76280): avc: denied { search } for name="/" dev="mmcblk0p37" ino=2 scontext=u:r:untrusted_app:s0:c232,c256,c512,c768 tcontext=u:object_r:factory_file:s0 tclass=dir permissive=0
[monodroid-assembly] open_from_bundles: failed to load assembly MauiAppGridProblem.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.Runtime.InteropServices.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/MauiAppGridProblem.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Java.Interop.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.InteropServices.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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:127 [0x00000].
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Threading.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Threading.Thread.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Diagnostics.StackTrace.dll [External]
[iappgridproble] Attempt to remove non-JNI local reference, dumping thread
Loaded assembly: data-0x73185d2f40 [External]
Loaded assembly: data-0x73185e5340 [External]
Loaded assembly: data-0x73185ff780 [External]
[monodroid-assembly] open_from_bundles: failed to load assembly netstandard.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/netstandard.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Linq.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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:423 [0x00000].
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Text.Json.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encodings.Web.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Text.Encodings.Web.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.ComponentModel.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.Controls.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.ObjectModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.Graphics.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.Essentials.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.Logging.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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.mauiappgridproblem/files/.__override__/System.Private.Uri.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Loader.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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:418 [0x00000].
[monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Memory.dll [External]
[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
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Reflection.Emit.Lightweight.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Reflection.Emit.ILGeneration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Reflection.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Core.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.Abstractions.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Console.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Console.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Xaml.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.Extensions.Logging.Debug.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.Controls.Xaml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.Configuration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.Configuration.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.Logging.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Extensions.Logging.Debug.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
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SwipeRefreshLayout.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.AppCompat.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.Google.Android.Material.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.SwipeRefreshLayout.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll
[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.ViewModel.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.SavedState.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Fragment.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Activity.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Lifecycle.Common.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.SavedState.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.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.DrawerLayout.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.CustomView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Navigation.Runtime.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Net.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Options.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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.mauiappgridproblem/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.mauiappgridproblem/files/.__override__/System.Diagnostics.Tracing.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.mauiappgridproblem/files/.__override__/System.Xml.ReaderWriter.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/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.mauiappgridproblem/files/.__override__/System.Text.Encoding.Extensions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Numerics.Vectors.dll [External]
[iappgridproble] Explicit concurrent copying GC freed 507(247KB) AllocSpace objects, 0(0B) LOS objects, 77% free, 1190KB/5286KB, paused 39us total 5.870ms
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Text.RegularExpressions.dll [External]
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
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.Serialization.Json.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Private.DataContractSerialization.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.Serialization.Xml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.Serialization.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.RecyclerView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CardView.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.RecyclerView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.CardView.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Loader.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Microsoft.Maui.Controls.Compatibility.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Window.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Window.dll [External]
[iappgridproble] Accessing hidden field Landroid/content/res/Configuration;->windowConfiguration:Landroid/app/WindowConfiguration; (greylist, reflection, allowed)
[iappgridproble] Accessing hidden method Landroid/app/WindowConfiguration;->getBounds()Landroid/graphics/Rect; (greylist, reflection, allowed)
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.CoordinatorLayout.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External]
[iappgridproble] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
[iappgridproble] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager2.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.ViewPager2.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Runtime.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.Lifecycle.Runtime.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/Xamarin.AndroidX.ViewPager.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly CommunityToolkit.Mvvm.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/CommunityToolkit.Mvvm.dll [External]
[iappgridproble] Explicit concurrent copying GC freed 1502(357KB) AllocSpace objects, 0(0B) LOS objects, 65% free, 2176KB/6272KB, paused 49us total 12.625ms
Thread started: .NET Timer #5
[AdrenoGLES] QUALCOMM build                   : 764348a, Ibbf9dc47ff
[AdrenoGLES] Build Date                       : 08/10/20
[AdrenoGLES] OpenGL ES Shader Compiler Version: EV031.27.05.08
[AdrenoGLES] Local Branch                     : 
[AdrenoGLES] Remote Branch                    : 
[AdrenoGLES] Remote Branch                    : 
[AdrenoGLES] Reconstruct Branch               : 
[AdrenoGLES] Build Config                     : S L 8.0.12 AArch64
[RenderThread] type=1400 audit(0.0:76282): avc: denied { search } for name="/" dev="mmcblk0p37" ino=2 scontext=u:r:untrusted_app:s0:c232,c256,c512,c768 tcontext=u:object_r:factory_file:s0 tclass=dir permissive=0
[AdrenoGLES] PFP: 0x005ff11a, ME: 0x005ff066
[iappgridproble] Explicit concurrent copying GC freed 3179(323KB) AllocSpace objects, 0(0B) LOS objects, 83% free, 2498KB/14MB, paused 42us total 12.477ms
[iappgridproble] Explicit concurrent copying GC freed 962(57KB) AllocSpace objects, 0(0B) LOS objects, 82% free, 2633KB/14MB, paused 42us total 12.763ms
[iappgridproble] Explicit concurrent copying GC freed 708(52KB) AllocSpace objects, 0(0B) LOS objects, 81% free, 2740KB/14MB, paused 39us total 13.413ms
[iappgridproble] Explicit concurrent copying GC freed 724(49KB) AllocSpace objects, 0(0B) LOS objects, 81% free, 2819KB/14MB, paused 42us total 14.016ms
Thread started: <Thread Pool> #6
Thread started: .NET ThreadPool Gate #7
Thread started: <Thread Pool> #8
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Intrinsics.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Runtime.Intrinsics.dll [External]
[iappgridproble] Explicit concurrent copying GC freed 654(90KB) AllocSpace objects, 0(0B) LOS objects, 80% free, 2889KB/14MB, paused 48us total 17.610ms
[iappgridproble] Explicit concurrent copying GC freed 646(42KB) AllocSpace objects, 0(0B) LOS objects, 80% free, 2959KB/14MB, paused 42us total 14.955ms
[monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.XmlSerializer.dll
Loaded assembly: /data/data/com.companyname.mauiappgridproblem/files/.__override__/System.Xml.XmlSerializer.dll [External]
[iappgridproble] Explicit concurrent copying GC freed 570(50KB) AllocSpace objects, 0(0B) LOS objects, 80% free, 3020KB/14MB, paused 42us total 15.236ms
[iappgridproble] Explicit concurrent copying GC freed 646(39KB) AllocSpace objects, 0(0B) LOS objects, 79% free, 3092KB/15MB, paused 45us total 15.755ms
[iappgridproble] Explicit concurrent copying GC freed 477(29KB) AllocSpace objects, 0(0B) LOS objects, 79% free, 3142KB/15MB, paused 40us total 15.369ms
[iappgridproble] Explicit concurrent copying GC freed 568(35KB) AllocSpace objects, 0(0B) LOS objects, 79% free, 3203KB/15MB, paused 40us total 16.266ms
[iappgridproble] Explicit concurrent copying GC freed 570(34KB) AllocSpace objects, 0(0B) LOS objects, 79% free, 3264KB/15MB, paused 41us total 16.740ms
[iappgridproble] Explicit concurrent copying GC freed 567(35KB) AllocSpace objects, 0(0B) LOS objects, 78% free, 3325KB/15MB, paused 41us total 16.995ms
[iappgridproble] Explicit concurrent copying GC freed 491(43KB) AllocSpace objects, 0(0B) LOS objects, 78% free, 3377KB/15MB, paused 41us total 17.012ms
[iappgridproble] WaitForGcToComplete blocked HeapTrim on HeapTrim for 8.893ms
[iappgridproble] Explicit concurrent copying GC freed 464(31KB) AllocSpace objects, 0(0B) LOS objects, 78% free, 3426KB/15MB, paused 43us total 19.310ms
[iappgridproble] Explicit concurrent copying GC freed 503(42KB) AllocSpace objects, 0(0B) LOS objects, 77% free, 3480KB/15MB, paused 43us total 18.348ms
[iappgridproble] Explicit concurrent copying GC freed 471(29KB) AllocSpace objects, 0(0B) LOS objects, 77% free, 3530KB/15MB, paused 40us total 18.498ms
[iappgridproble] Explicit concurrent copying GC freed 461(31KB) AllocSpace objects, 0(0B) LOS objects, 77% free, 3578KB/15MB, paused 42us total 18.960ms
[iappgridproble] Explicit concurrent copying GC freed 400(38KB) AllocSpace objects, 0(0B) LOS objects, 77% free, 3620KB/15MB, paused 41us total 19.055ms
[iappgridproble] Explicit concurrent copying GC freed 491(43KB) AllocSpace objects, 0(0B) LOS objects, 76% free, 3672KB/15MB, paused 41us total 19.380ms
[iappgridproble] Explicit concurrent copying GC freed 413(35KB) AllocSpace objects, 0(0B) LOS objects, 76% free, 3716KB/15MB, paused 41us total 19.421ms
[iappgridproble] Explicit concurrent copying GC freed 402(37KB) AllocSpace objects, 0(0B) LOS objects, 76% free, 3759KB/15MB, paused 56us total 23.172ms
[iappgridproble] Explicit concurrent copying GC freed 414(35KB) AllocSpace objects, 0(0B) LOS objects, 76% free, 3803KB/15MB, paused 40us total 20.282ms
[iappgridproble] Explicit concurrent copying GC freed 444(40KB) AllocSpace objects, 0(0B) LOS objects, 76% free, 3859KB/15MB, paused 43us total 21.099ms
[iappgridproble] Explicit concurrent copying GC freed 371(28KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 3895KB/15MB, paused 41us total 21.714ms
[iappgridproble] Explicit concurrent copying GC freed 414(35KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 3939KB/15MB, paused 42us total 21.153ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 3973KB/15MB, paused 41us total 21.194ms
[iappgridproble] Explicit concurrent copying GC freed 414(35KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 4017KB/15MB, paused 46us total 21.484ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 4050KB/15MB, paused 42us total 21.716ms
[iappgridproble] Explicit concurrent copying GC freed 413(35KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 4094KB/15MB, paused 41us total 22.035ms
[iappgridproble] Explicit concurrent copying GC freed 410(37KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4137KB/16MB, paused 42us total 28.044ms
[iappgridproble] Explicit concurrent copying GC freed 250(37KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4163KB/16MB, paused 42us total 22.509ms
[iappgridproble] Explicit concurrent copying GC freed 413(35KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4207KB/16MB, paused 42us total 24.064ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4241KB/16MB, paused 41us total 22.919ms
[iappgridproble] Explicit concurrent copying GC freed 337(28KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4276KB/16MB, paused 42us total 23.027ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 74% free, 4310KB/16MB, paused 41us total 23.238ms
[iappgridproble] Explicit concurrent copying GC freed 336(28KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4346KB/16MB, paused 41us total 23.629ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4379KB/16MB, paused 46us total 24.015ms
[iappgridproble] Explicit concurrent copying GC freed 337(28KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4415KB/16MB, paused 42us total 24.015ms
[iappgridproble] Explicit concurrent copying GC freed 323(30KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4448KB/16MB, paused 42us total 24.324ms
[iappgridproble] Explicit concurrent copying GC freed 337(28KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4484KB/16MB, paused 41us total 29.087ms
[iappgridproble] Explicit concurrent copying GC freed 337(37KB) AllocSpace objects, 0(0B) LOS objects, 73% free, 4526KB/16MB, paused 41us total 24.480ms
[iappgridproble] Explicit concurrent copying GC freed 246(27KB) AllocSpace objects, 0(0B) LOS objects, 72% free, 4562KB/16MB, paused 40us total 24.993ms
[iappgridproble] Explicit concurrent copying GC freed 261(27KB) AllocSpace objects, 0(0B) LOS objects, 72% free, 4599KB/16MB, paused 42us total 26.638ms
Thread started: <Thread Pool> #9
[iappgridproble] Explicit concurrent copying GC freed 1106(72KB) AllocSpace objects, 0(0B) LOS objects, 72% free, 4670KB/16MB, paused 43us total 25.529ms
[RenderThread] type=1400 audit(0.0:76285): avc: denied { search } for name="/" dev="mmcblk0p37" ino=2 scontext=u:r:untrusted_app:s0:c232,c256,c512,c768 tcontext=u:object_r:factory_file:s0 tclass=dir permissive=0
[OpenGLRenderer] Davey! duration=19600ms; Flags=1, IntendedVsync=49325058781385, Vsync=49325075448051, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=49325084811651, AnimationStart=49325084903890, PerformTraversalsStart=49325084908161, DrawStart=49343840954612, SyncQueued=49344464562060, SyncStart=49344465241644, IssueDrawCommandsStart=49344475823258, SwapBuffers=49344652157373, FrameCompleted=49344659975602, DequeueBufferDuration=9254000, QueueBufferDuration=2483000, 
[Choreographer] Skipped 1174 frames!  The application may be doing too much work on its main thread.
[OpenGLRenderer] Davey! duration=19604ms; Flags=0, IntendedVsync=49325092199134, Vsync=49344658865018, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=49344663062425, AnimationStart=49344663245862, PerformTraversalsStart=49344663305446, DrawStart=49344664854664, SyncQueued=49344664935810, SyncStart=49344665293050, IssueDrawCommandsStart=49344670255133, SwapBuffers=49344694416696, FrameCompleted=49344697433258, DequeueBufferDuration=9540000, QueueBufferDuration=1304000, 
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
[iappgridproble] Explicit concurrent copying GC freed 8141(542KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 5137KB/17MB, paused 62us total 36.382ms
[iappgridproble] Explicit concurrent copying GC freed 1263(71KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 5098KB/16MB, paused 45us total 31.199ms
Thread started: <Thread Pool> #14
Thread started: <Thread Pool> #15
Thread finished: <Thread Pool> #9
Thread finished: <Thread Pool> #14
Thread finished: <Thread Pool> #10
Thread finished: <Thread Pool> #11
Thread finished: <Thread Pool> #6
Thread finished: <Thread Pool> #15
Thread finished: <Thread Pool> #13
Il thread 0x9 è terminato con il codice 0 (0x0).
Il thread 0xe è terminato con il codice 0 (0x0).
Il thread 0xa è terminato con il codice 0 (0x0).
Il thread 0xb è terminato con il codice 0 (0x0).
Il thread 0x6 è terminato con il codice 0 (0x0).
Il thread 0xf è terminato con il codice 0 (0x0).
Il thread 0xd è terminato con il codice 0 (0x0).
hartez commented 1 year ago

a collectionview inside a stacklayout

Why are you putting a CollectionView inside of a StackLayout?

acaliaro commented 1 year ago

a collectionview inside a stacklayout

Why are you putting a CollectionView inside of a StackLayout?

I don't understand the question. Is forbidden?

acaliaro commented 1 year ago

https://github.com/dotnet/maui/issues/8888#issuecomment-1192527270 I read this.. Really? Is this the motivation? So do I have to be careful what layout I use to hold a collectionview?

needledrag commented 1 year ago

I can't see your repository code but If you have a grid with row Auto the 'Explicit concurrent copying GC freed' seems to kick in in full force. If you have any Auto rows try setting them to another value to alleviate it.

hartez commented 1 year ago

#8888 (comment) I read this.. Really? Is this the motivation? So do I have to be careful what layout I use to hold a collectionview?

Well, you need to use an appropriate layout for whatever it is that you're trying to achieve. If you want the CollectionView to fit into a limited vertical space and be scrollable, then a vertically-oriented stacking layout is probably not what you're looking for.

Also, I'm asking because I can't see your code; the repro project you linked to seems to be empty. Are you wrapping the CollectionView in a StackLayout to provide some other layout feature (like a margin, or padding, or background)? Does the StackLayout have other controls in it?

acaliaro commented 1 year ago

I can't see your repository code but If you have a grid with row Auto the 'Explicit concurrent copying GC freed' seems to kick in in full force. If you have any Auto rows try setting them to another value to alleviate it.

Sorry, now you should see the repo

acaliaro commented 1 year ago

#8888 (comment) I read this.. Really? Is this the motivation? So do I have to be careful what layout I use to hold a collectionview?

Well, you need to use an appropriate layout for whatever it is that you're trying to achieve. If you want the CollectionView to fit into a limited vertical space and be scrollable, then a vertically-oriented stacking layout is probably not what you're looking for.

Also, I'm asking because I can't see your code; the repro project you linked to seems to be empty. Are you wrapping the CollectionView in a StackLayout to provide some other layout feature (like a margin, or padding, or background)? Does the StackLayout have other controls in it?

I wrap the CV inside a StackLayout because I would like to add more controls before the collectionview. In the repo I added a verticalStackLayout in row 1 column 2 position with some labels before the collectionview: same result, scroll doesn't work.

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

dersia commented 1 year ago

Honestly this is a major issue. I am trying to set all the HeightRequests, but this doesn't make sense. I am using the same "Component" over and over again, inside this component, there is a grid, a label and a collectionview. within that collectionview I am using a DataTemplateSelector to decide which of the datatemplates to load and based on their "type" (small, medium, large) I am using different Widths... the need to set Heights defies the purpose of VerticalOptions FillAndExpand. Those "Components" are in a VStackLayout inside a StackLayout because there are multiple "Components" and over Controls on the Page.

So is there a fix for this planned, is there a workaround? Can I help with the implementation of a fix? Right now I have no clue where this is even coming form :/

Almis90 commented 1 year ago

The issues I've experienced, such as this, are what led me to step away from Xamarin and consider other solutions. It can be incredibly frustrating when fundamental aspects don't work properly, I hope MAUI will not continue the same path. Anyway here is a temporary solution.

<ContentPage>
    <Grid
        x:Name="ParentGrid"
        SizeChanged="ParentGrid_SizeChanged">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <CollectionView
            x:Name="MessagesCollectionView"
            ItemTemplate="{StaticResource MessageTemplateSelector}"
            Grid.Row="0">
        </CollectionView>
        <Grid
            x:Name="NewMessageGrid"
            Grid.Row="1">
        </Grid>
    </Grid>
</ContentPage>

public partial class ChatPage : ContentPage
{    
    void ParentGrid_SizeChanged(System.Object sender, System.EventArgs e)
    {
        MessagesCollectionView.HeightRequest = ParentGrid.Height - (MessageGrid.Height + ParentGrid.Margin.Top + ParentGrid.Margin.Bottom);
    }
}
XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Android 13.0-API33 with below Project: MauiAppGridProblem.zip

DamianSuess commented 1 year ago

Not sure if this is related. If not, let me know and I'll create a new issue.

.NET MAUI 7.0:

Inside of a CollectionView using a <Grid ColumnDefinitions="*, Auto"> with only the first column implemented, the unused Auto causes the row to not show the text. Only after resizing the window (on desktop) does the screen resize the row and show the text, otherwise this will always appear as a blank row. Once you remove the unused column definition of Auto the CollectionView shows the row just fine.

BTW, this bug helped uncover our developer defining an unused column definition. Sooo.. win/win?

<CollectionView ItemsSource="{Binding Devices}"
                SelectedItem="{Binding DeviceSelected, Mode=TwoWay}"
                SelectionMode="Single">
  <CollectionView.ItemTemplate>
    <DataTemplate x:DataType="models:DeviceListItem">
        <SwipeView>
          <SwipeView.RightItems>
            <!-- (code removed for bug clarity) -->
          </SwipeView.RightItems>
        <!--
          BUG:
          When using AUTO and the 2nd column is not provided, the screen doesn't render
          the text until the window is resized (Windows desktop), otherwise, it stays blank (i.e. Android)
        -->
        <Grid ColumnDefinitions="*,Auto">
          <Label Text="{Binding DisplayName}"
                 FontSize="Large"
                 TextColor="AliceBlue" />
        </Grid>
      </SwipeView>
    </DataTemplate>
  </CollectionView.ItemTemplate>
</CollectionView>

image

axa88 commented 11 months ago

the row to not show the text. Only after resizing the window (on desktop) does the screen resize the row and show the text,

Ive found this or very similar behavior of text missing from the selected item of a Picker, which was inside of a CollectionView, where resizing the WinUI Window immediately resolves the issue. After minor adjustments for Margin/Padding, and swapping an encapsulating Frame for Border, the problem stopped happening. In other words there appears to me a problem with text appearance in controls within a CollectionView, but to me it doesn't appear related to this bug at all.

RuddyOne commented 5 months ago

Also seeing issues similar to this on Android.

If you have a Collectionview inside of a Grid with rows setup as "Auto,*" (Stacklayout row 0, Collectionview row 1). Then the collection view when populated seems to randomly start from the bottom cell. You have to scroll back up to get to the top. Weird.

Any movement on this issue?