Xamarin.forms: [Bug] X.F 4.0 Grid inside listview throwing null exception

Created on 24 May 2019  ·  5Comments  ·  Source: xamarin/Xamarin.Forms

Grid.MeasuredStarredColumns (System.Double widthConstraint, System.Double heightConstraint)

D:\a1\s\Xamarin.Forms.Core\GridCalc.cs, line 436 throws System.NullReferenceException: Object reference not set to an instance of an object.

Steps to Reproduce

  1. Create a listview in XAML
  2. Use ViewCell and place a Grid inside it with width *
  3. Run and navigate to the view

UI is loaded correctly similar to X.F 3.6

Throws Null reference exception

Basic Information

  • Version with issue: 4.0.0.425677
  • Last known good version: 3.6.0.344457
  • IDE: VS2017
  • Platform Target Frameworks:

    • iOS: 11.0

    • Android: 9.0

  • Android Support Library Version: 28.0.0.1
  • Nuget Packages:
  • Affected Devices: Android

Screenshots

Reproduction Link

fastrenderers listview high regression Android needs-info ❓ needs-repro ❔ unverified bug

All 5 comments

Observed a related issue in Visual Studio 2019 for Mac / Xamarin. Reverting to Xamarin.Forms.3.6.0.344457 fixes the problem.

  • Exception: System.NullReferenceException
  • Message: Object reference not set to an instance of an object.
  • Source: Xamarin.Forms.Core
  • Stack Trace: See attached
    stacktrace.txt

Stumbled upon the same issue when upgrading Xamarin Forms from 3.6 to 4, setting Forms.SetFlags("UseLegacyRenderers"); in MainActivity.cs solved the issue (for now) for me.

@jepl4052 - Nice work. I saw this MS doc that discusses backward compatibility of Xamarin.Forms Fast Renderers. Looks like this "bug" is actually Xamarin.Forms 4 working as intended.

Issue6300.zip

@rohitvipin I was unable to reproduce this. Can you please alter the attached solution such that it demonstrates the issue? Thanks!

Was this page helpful?
0 / 5 - 0 ratings