Bug 58106 - Android Designer: Load fails due to internal error, NullPointerException for versions < Android 5.0 / API 21
Summary: Android Designer: Load fails due to internal error, NullPointerException for ...
Status: RESOLVED DUPLICATE of bug 56272
Alias: None
Product: Android
Classification: Xamarin
Component: Designer ()
Version: 7.3 (15.2)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jérémie Laval
Depends on:
Reported: 2017-07-12 14:25 UTC by Ashley Gazich [MSFT]
Modified: 2017-07-17 17:38 UTC (History)
2 users (show)

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

IDE logs (15.02 KB, application/zip)
2017-07-12 14:50 UTC, Ashley Gazich [MSFT]

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 Ashley Gazich [MSFT] 2017-07-12 14:25:44 UTC
## Reproduction steps

1. Create new Android app from template
2. Open Main.axml
3. From the version dropdown, choose an Android version < 5.0

## Expected behavior

Layout loads

## Actual Behavior

Indirect rendering enabled
mono.android.DesignerException: java.lang.IllegalStateException
	at mono.android.DesignerException.fromThrowable(DesignerException.java:46)
	at mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:187)
	at mono.android.DesignerSession.load(DesignerSession.java:239)
	at mono.android.DesignerSession.processMessage(DesignerSession.java:704)
	at mono.android.MessageListener.executeMessage(MessageListener.java:88)
	at mono.android.MessageListener$Runner.run(MessageListener.java:44)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: The main Looper has already been prepared.
	at android.os.Looper.prepareMainLooper(Looper.java:104)
	at com.android.layoutlib.bridge.Bridge.prepareThread(Bridge.java:544)
	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
	at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
	at mono.android.DesignerSession.load(DesignerSession.java:233)

## Version info

=== Visual Studio Enterprise 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 1258)
Installation UUID: ffddd24a-501d-42b0-a2b2-3351f2ab51c9
	Mono (2017-04/478c04a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000196

=== NuGet ===


=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
SDK: /usr/local/share/dotnet/sdk/1.0.1/Sdks
SDK Version: 1.0.1
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

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

=== Xamarin.Android ===

Version: (Visual Studio Enterprise)
Android SDK: /Users/ashleyg/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		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)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.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:

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: (Visual Studio Enterprise)
Hash: 494fcbcf
Branch: d15-3
Build date: 2017-06-23 12:25:55-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise)

=== Build Information ===

Release ID: 701001258
Git revision: b0333c272ef55159b4c209e71698203d2fb4acdd
Build date: 2017-06-26 17:47:47-04
Xamarin addins: 31cc58bd6e356d0e68b4dd5c9b51283f1506ce99
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

AddinMaker 1.3.7
Comment 2 Ashley Gazich [MSFT] 2017-07-12 14:50:00 UTC
Created attachment 23502 [details]
IDE logs
Comment 3 Jon Douglas [MSFT] 2017-07-17 17:38:08 UTC

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