Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
When specifying Thickness with Left/Right/Top/Bottom attributes in a ResourceDictionary in App.xaml and enabling precompiling of xaml via [assembly: XamlCompilation(XamlCompilationOptions.Compile)] will crash the app on Android (tested on Samsung S7, not tested on iOS).
- create a new Cross Platform Xamarin app using PCL
- add following to App.xaml:
<!-- <Thickness x:Key="PageMargin">10,0,10,0</Thickness> -->
<Thickness x:Key="PageMargin" Left="10" Right="10" Bottom="0" Top="0" />
- change MainPage.xaml, and add attributes to label:
Build and run on Android.
Add [assembly: XamlCompilation(XamlCompilationOptions.Compile)] above namespace decleration in App.xaml.cs
Build and run on Android -> Crash while running InitializeComponent(); within the App constructor.
When using the first form to specify Thickness, everything works ok when using XamlCompilation.
Thank you for filing this report! Let me try the steps you provided to see if can reproduce and confirm this issue. I will update the report accordingly.
Created attachment 20319 [details]
I was able to reproduce this crash with the repro project I'm attaching with Forms 184.108.40.206. The app would crash on all platforms upon launching. On Android the debug output showed:
> 03-14 11:23:06.697 E/mono ( 1788): Unhandled Exception:
> 03-14 11:23:06.697 E/mono ( 1788): System.InvalidProgramException: Invalid IL code in XamlCTest.App:InitializeComponent (): IL_0050: callvirt 0x0a00000a
### Resolution status
I tested with Forms 2.3.4-pre4 and the crash no longer occurs so this issue appears to have been fixed. If you still experience this issue with Forms 2.3.4-pre4 or later please re-open this bug and attach an updated repro project.
### Version Tests
Forms 2.3.4-pre4 GOOD
Forms 220.127.116.11 BAD