Bug 45287 - Android Designer Fails to Load Layout. Hangs while opening, required IDE restart.
Summary: Android Designer Fails to Load Layout. Hangs while opening, required IDE rest...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: Designer ()
Version: 7.0 (C8)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jérémie Laval
URL:
Depends on:
Blocks:
 
Reported: 2016-10-11 18:50 UTC by PK
Modified: 2017-06-28 02:24 UTC (History)
5 users (show)

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


Attachments
Relevant exceptions in the ide log (40.11 KB, text/plain)
2016-10-11 18:50 UTC, PK
Details
IDE log file (57.96 KB, text/plain)
2016-12-01 00:36 UTC, Paul Johnson
Details
Logs (4.95 KB, application/x-zip-compressed)
2017-03-14 19:33 UTC, Jeremy Kolb
Details


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 NOT_REPRODUCIBLE

Description PK 2016-10-11 18:50:46 UTC
Created attachment 17984 [details]
Relevant exceptions in the ide log

Simply opening a .axml layout files using the quick search results in the IDE never completing the process. Relevant portion of the stack trace from the IDE log is attached.

Xamarin Studio Info:
=== Xamarin Studio Business ===

Version 6.1.1 (build 15)
Installation UUID: 6c1c83bf-9b64-4f0d-b5ba-297d823facb8
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/ef43c15) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.Mac ===

Version: 2.10.0.105 (Xamarin Business)

=== Xamarin.iOS ===

Version: 10.0.1.10 (Xamarin Business)
Hash: ad1cd42
Branch: cycle8-sr0-xi
Build date: 2016-10-03 15:18:44-0400

=== Xamarin.Android ===

Version: 7.0.1.3 (Xamarin Business)
Android SDK: /Users/xxx/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		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)
		6.0    (API level 23)
		7.0    (API level 24)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24.0.2
SDK Build Tools Version: 23.0.2

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)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin Inspector ===

Version: 0.9.0.14
Hash: 4d868da
Branch: master
Build date: Mon Jun 13 19:14:13 UTC 2016

=== Build Information ===

Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0

=== Operating System ===

Mac OS X 10.11.6
Darwin xxx-mbp2.local 15.6.0 Darwin Kernel Version 15.6.0
    Thu Jun 23 18:25:34 PDT 2016
    root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Xamarin Inspector 0.9.0.14
Comment 1 Ashley Gazich [MSFT] 2016-10-14 17:22:24 UTC
Hi, could you try updating to JDK 1.8 to see if that helps? If it does not, please attach your IDE logs from Help > Open Log Directory.

I am unable to reproduce a hang using this sample https://developer.xamarin.com/samples/monodroid/android5.0/KitchenSink/

with

=== Xamarin Studio Enterprise ===

Version 6.1.1 (build 15)
Installation UUID: 3bf0795e-4e95-43d1-847f-d23b467050f6
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/ef43c15) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 7.0.1.3 (Xamarin Enterprise)
Android SDK: /Users/ashleyg/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		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)
		6.0    (API level 23)
		7.0    (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 24.0.3

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.iOS ===

Version: 10.0.1.10 (Xamarin Enterprise)
Hash: ad1cd42
Branch: cycle8-sr0-xi
Build date: 2016-10-03 15:18:44-0400

=== Xamarin.Mac ===

Version: 2.10.0.105 (Xamarin Enterprise)

=== Build Information ===

Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0

=== Operating System ===

Mac OS X 10.11.6
Darwin ashleyg.local 15.6.0 Darwin Kernel Version 15.6.0
    Mon Aug 29 20:21:34 PDT 2016
    root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
Comment 2 Paul Johnson 2016-12-01 00:35:49 UTC
I'm seeing this too.
Comment 3 Paul Johnson 2016-12-01 00:36:51 UTC
Created attachment 18730 [details]
IDE log file
Comment 4 Paul Johnson 2016-12-01 00:37:33 UTC
=== Xamarin Studio Business ===

Version 6.1.2 (build 44)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
Runtime:
	Mono 4.6.2 (mono-4.6.0-branch/08fd525) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406020007

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Version: 0.24.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.1 (11544)
Build 8B62

=== Xamarin.Android ===

Version: 7.0.2.37 (Xamarin Business)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	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)
		6.0    (API level 23)
		7.0    (API level 24)

SDK Tools Version: 25.2.3
SDK Platform Tools Version: 25.0.1
SDK Build Tools Version: 25

Java SDK: /usr
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.10.0.113 (Xamarin Business)

=== Xamarin.iOS ===

Version: 10.2.1.5 (Xamarin Business)
Hash: 44931ae
Branch: xcode8.1
Build date: 2016-11-01 20:52:28-0400

=== Build Information ===

Release ID: 601020044
Git revision: 0ccfcd52b95305ebd5b7eca0d88c1017035910ae
Build date: 2016-10-28 15:12:43-04
Xamarin addins: a39a869d8a78d87bdc6775f696c13a4cc9024501
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.1
Darwin iMac.local 16.1.0 Darwin Kernel Version 16.1.0
    Thu Oct 13 21:26:57 PDT 2016
    root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

MonoGame Addin 3.6.0.906
Comment 5 Jeremy Kolb 2017-03-14 19:33:37 UTC
Created attachment 20323 [details]
Logs

I see this too on latest stable.
Comment 6 Ashley Gazich [MSFT] 2017-03-20 21:38:29 UTC
@Jeremy, this report was filed for opening layout files in Xamarin Studio Mac via quick search. Your logs indicate you are using Xamarin for Visual Studio v4.3.0.784, and contain the following

ERROR: An exception occured while loading control android.support.design.widget.TextInputLayout
Xamarin.VisualStudio.ActivationManager|Information|0|ERROR: java.lang.reflect.InvocationTargetException

Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
Xamarin.VisualStudio.ActivationManager|Information|0|	at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:36)
Xamarin.VisualStudio.ActivationManager|Information|0|	at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:168)
Xamarin.VisualStudio.ActivationManager|Information|0|	at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:161)
Comment 8 Jeremy Kolb 2017-03-20 22:30:35 UTC
So apparently it happens on both platforms.
Comment 9 Jérémie Laval 2017-03-21 21:17:41 UTC
Hey Jeremy,

You seem to be using AppCompat in your layout (TextInputLayout), to be able to render this kind of layout you need to select an AppCompat theme (or your own derivative) in the designer theme dropdown or set it up directly in your Android Manifest properties (project settings or directly by opening AndroidManifest.xml)
Comment 10 Jeremy Kolb 2017-03-21 22:36:16 UTC
That is true.  It then renders but unfortunately that doesn't appear to be what this issue is about (designer hangs).

As an aside: does the designer support the `tools:context` attribute?  That would provide an alternate way to fix the rendering issue.
Comment 11 Cody Beyer (MSFT) 2017-06-28 02:24:26 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please reopen this issue and attach a reproduction to the bug by starting with a clean Xamarin.Android project adding just the code necessary to demonstrate the issue.