Bug 42385 - XAMLC Padding Thickness Properties
Summary: XAMLC Padding Thickness Properties
Status: RESOLVED DUPLICATE of bug 46921
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-07-06 15:56 UTC by Hines Vaughan III
Modified: 2017-01-18 09:33 UTC (History)
5 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 46921

Description Hines Vaughan III 2016-07-06 15:56:54 UTC
The following XAML code works fine without XAMLC but throws a runtime InvalidProgramException with XAMLC enabled on iOS and Android:

<Grid>
  <Grid.Padding>
    <Thickness Top="25" Bottom="0" Left="0" Right="0"/>
  </Grid.Padding>
</Grid>

-OR-

<Grid>
  <Grid.Padding>
    <Thickness Top="25"/>
  </Grid.Padding>
</Grid>

If instead you specify Padding like below, everything works fine:

<Grid Padding="0,25,0,0"/>

The Grid above is in a ContentPage which is in a TabbedPage, but this also happens with just a ContentPage. I am using the latest Xamarin Forms libraries in all projects. This happens on an Android (4.2.2) Galaxy SII Mini and on an iOS 8.1 iPhone 4s simulator. Have not tried testing on anything else.

The Android StackTrace:

Unhandled Exception:
System.InvalidProgramException: Invalid IL code in project.Shared.Pages.ProfileListPage:InitializeComponent (): IL_0252: callvirt  0x0a000452


  at project.Shared.Pages.ProfileListPage..ctor () [0x0000a] in c:\Users\me\Source\Repos\dir\project\project\project.Shared\Pages\ProfileListPage.xaml.cs:25 
  at project.Shared.Pages.ApplicationSettingsTabbedPage.InitializeComponent () [0x0000c] in <filename unknown>:0 
  at project.Shared.Pages.ApplicationSettingsTabbedPage..ctor () [0x00008] in c:\Users\me\Source\Repos\dir\project\project\project.Shared\Pages\ApplicationSettingsTabbedPage.xaml.cs:16 
  at project.Droid.MainActivity+<>c__DisplayClass12+<<OnCreateOptionsMenu>b__10>d__18.MoveNext () [0x001b5] in c:\Users\me\Source\Repos\dir\project\project\project.Droid\MainActivity.cs:216
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper dynamic-method) System.Object:48938c3c-8354-44c8-8a1c-764b5d390565 (intptr,intptr)
  at (wrapper native-to-managed) System.Object:48938c3c-8354-44c8-8a1c-764b5d390565 (intptr,intptr)

[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in project.Shared.Pages.ProfileListPage:InitializeComponent (): IL_0252: callvirt  0x0a000452


  at project.Shared.Pages.FlightProfileListPage..ctor () [0x0000a] in c:\Users\me\Source\Repos\dir\project\project\project.Shared\Pages\ProfileListPage.xaml.cs:25 
  at project.Shared.Pages.ApplicationSettingsTabbedPage.InitializeComponent () [0x0000c] in <filename unknown>:0 
  at project.Shared.Pages.ApplicationSettingsTabbedPage..ctor () [0x00008] in c:\Users\me\Source\Repos\dir\project\project\project.Shared\Pages\ApplicationSettingsTabbedPage.xaml.cs:16 
  at project.Droid.MainActivity+<>c__DisplayClass12+<<OnCreateOptionsMenu>b__10>d__18.MoveNext () [0x001b5] in c:\Users\me\Source\Repos\dir\project\project\project.Droid\MainActivity.cs:216
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper dynamic-method) System.Object:48938c3c-8354-44c8-8a1c-764b5d390565 (intptr,intptr)
  at (wrapper native-to-managed) System.Object:48938c3c-8354-44c8-8a1c-764b5d390565 (intptr,intptr)
Comment 1 Samantha Houts [MSFT] 2016-07-06 17:51:10 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.  

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d  

Warm regards, 
Xamarin Forms Team
Comment 2 Hines Vaughan III 2016-07-06 18:34:59 UTC
Below is a URL to a zip containing the reproduction of the issue.

More importantly though, how were you not able to reproduce this...? I know this will make me sound like a jerk, but submitting bug reports and reproducing issues is not my job, its your job. When a bug is difficult to reproduce or is complicated, I have always been happy to help but this was the simplest bug I have ever reported.

I gave all of the code needed except for the XAMLC annotation. What exactly did you even try in order to reproduce this? All that was needed was a Grid on a ContentPage and I gave you all of that code above.

It is frustrating to me because it feel like I am being asked to do someone else's job when that task is extremely simple for them to do but is tedious. I can assure you that it is tedious for me as well.

https://drive.google.com/file/d/0ByyteAbljnwFQWJIR3NRRnJmT1E/view?usp=sharing

Let me know what else might be needed.
Comment 3 Samantha Houts [MSFT] 2016-07-06 22:36:51 UTC
Thank you for the reproduction. When I attempted to reproduce this earlier with my own test code, I did see a crash, but it was not the same crash you described. Your reproduction project will ensure that we are, indeed, fixing your exact issue.
Comment 4 Stephane Delcroix 2017-01-18 09:33:53 UTC

*** This bug has been marked as a duplicate of bug 46921 ***