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.
Steps to reproduce:
1. Open X.S
2. Create android template application.
3. Open Resources->Layout->Main.axml file
4. Observe that default button "Hello World, Click Me!" appears in portrait mode.
5. Now click 'Alternative Layout'->New Version select Screen Orientation as Landscape.
6. Observe that default button "Hello World, Click Me!" appears in landscape mode as well.
7. Delete this button and add another one.
8. Debug or run the sample.
9. Change Device/Emulator Orientation.
Actual Result: Application get crashed after changing Orientation. If user does not delete default button "Hello World, Click Me!" from landscape mode and then change Orientation after deploying application then it is working fine.
Expected Result: User should able to change Orientation.
Exception Details: https://gist.github.com/saurabh360/5bf41c8edd9b0f515402
Android Log: https://gist.github.com/saurabh360/281a242e951c21e59699
ADB Logcat: https://gist.github.com/saurabh360/b1d0cbd15421679f0e66
All Mac and Windows
X.S 4.2.2(build 2)
Regression Status: Same behavior is happening with stable X.Android 4.10.1-73
An update to the above issue
Correct Version of XS is 4.2.3 (build 20)
Please ignore 'XS version' of Environment details mention in bug.
This is not a valid bug, what you've done is create an alternate layout in the editor, but you have not properly handled that change in the main activity.
Creating a new button in landscape creates a button with id `button1`, but in the main activity, it is looking for a button with the id `myButton` (which only exists in portrait mode).
As a result the following line fails, and your button is null (which will throw an NRE when we attempt to use that button in the next line).
Button button = FindViewById<Button> (Resource.Id.myButton);
AS per comment 3, this issue is invalid.
Hence closing this issue.