Bug 33389 - Designer throws exception if switch added to a layout when targeting 5.1
Summary: Designer throws exception if switch added to a layout when targeting 5.1
Status: RESOLVED DUPLICATE of bug 33174
Alias: None
Product: Android
Classification: Xamarin
Component: Designer ()
Version: 5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jérémie Laval
Depends on:
Reported: 2015-08-26 05:16 UTC by Ryan
Modified: 2015-09-11 13:27 UTC (History)
3 users (show)

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

Sample project demonstrating designer exception (22 bytes, text/plain)
2015-08-27 04:16 UTC, Ryan

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:

Description Ryan 2015-08-26 05:16:03 UTC
After upgrading to SDK 24.3.4 if you add a switch to a layout file in an Android project targeting 5.1 the designer throws an exception. If you change the project to target a lower version then the layout loads properly.

To reproduce:

XS 5.9.5
SDK 24.3.4
Mac OSX Yosemite 10.10.4

- Start a new blank Android project
- Open the included layout file
- Drag on a switch
- Switch the project to target XA 5.1, check the layout, and then switch to target an earlier version and check again.

Expected: The layout should load
Actual: The layout loads when targeting pre 5.1, fails on 5.1.
Comment 1 Ashley Gazich [MSFT] 2015-08-26 14:17:40 UTC
Designer throws exception if switch added to a layout when targeting 5.1 

##Steps to reproduce

Tested against all supported API’s listed below using the following method:

1. Open new Xamarin.Android project in Xamarin Studio
2, Open Project > Resources > layout > Main.axml
3. Drag & drop a Switch
4. Open project options
5. Go to Build > General > Target framework
6. Choose previous Android version
7. Select OK
8. Allow any layout changes to load
9. Repeat all steps, selecting a different target framework each time at step #6. 

## Version information

 === Xamarin Studio ===

Version 5.9.5 (build 10)
Installation UUID: c442567b-f0ca-4cb3-b826-d4d99f1d8a93
Mono 4.0.3 ((detached/d6946b4)
GTK+ 2.24.23 (Raleigh theme)

Package version: 400030020

=== Apple Developer Tools ===

Xcode 6.4 (7720)
Build 6E35b

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 2c66d2f
Branch: master
Build date: 2015-08-04 13:52:25-0400

=== Xamarin.Android ===

Version: (Enterprise Edition)
Android SDK: /Users/ashleyg/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3    (API level 10)
4.0.3  (API level 15)
4.1    (API level 16)
4.2    (API level 17)
4.3    (API level 18)
4.4    (API level 19)
4.4.87 (API level 20)
5.0    (API level 21)
5.1    (API level 22)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Enterprise Edition)

=== Build Information ===

Release ID: 509050010
Git revision: 48d16bc4f12ce3938964fc7c3d72fdc6887ad4ad
Build date: 2015-08-18 16:55:24-04
Xamarin addins: c2d51b360ad9f59e689046d47030df27de28f94a

=== Operating System ===

Mac OS X 10.10.5
Darwin ashleyg.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64

## Results

Unable to reproduce the exception. Can you provide more detailed instructions or further information?
Do you see it in a new project from template?
If you can provide a sample demonstrating this behavior, that would be very helpful.
Comment 2 Ryan 2015-08-27 04:07:16 UTC
Hi Ashley,

I did literally what you did, just added a switch to a blank project. I take it you are using the same SDK Tools as me as this is what caused the problem to appear. I also notice you are on OSX 10.10.5 wheras I am on 10.10.4. Probably unrelated but worth a mention.

I will see if I can upload a sample.
Comment 3 Ryan 2015-08-27 04:16:02 UTC
Created attachment 12659 [details]
Sample project demonstrating designer exception

To reproduce the exception:

- Set the project to target 5.1 (Options/Build/General/TargetFramework).
- Open the Main.axml layout

If you change the target to anything else then the layout will load properly with no exception.
Comment 4 Ryan 2015-09-03 12:18:50 UTC
Hi Ashley,

Any update on this? Do you see the same problem when you load my example project?

Comment 5 Ashley Gazich [MSFT] 2015-09-04 16:33:18 UTC
Marking duplicate. Verified fix released.

*** This bug has been marked as a duplicate of bug 33174 ***
Comment 6 Ryan 2015-09-07 04:19:57 UTC
Hi Ashley,

I see you have marked this as a duplicate of a different bug. I am up to date with Xamarin and still seeing these issues, is the fix supposed to be live, or is it in the beta / alpha channels? A little more info would have been nice instead of just closing my ticket.

Thanks for your help,
Comment 7 Dominic N [MSFT] 2015-09-11 13:27:14 UTC
@Ryan - based on the descriptions you've provided, it seems that this issue is related to the one Ashley linked.

I can not reproduce using your sample project or a project created from template. If you're still seeing the issue, please do the following:

1. Ensure your Xamarin installation is up to date with the newest stable channel
2. Try removing and resinstalling the Android build tool 24.3.4
3. If you still see an error, please:
3a. Take a screenshot of said error
3b. Copy the entire text of said error and paste it in a Gist or attach as a text file to this bug
3c. Retrieve and attach your full Xamarin Studio version information from "Xamarin Studio -> About Xamarin Studio -> Show Details -> Copy Information [button]" to this bug