Bug 58223 - Android Designer could not run because: The layout renderer could not be started. This may be caused by a misconfiguration of Java. Please install it or set Java Development Kit Path.
Summary: Android Designer could not run because: The layout renderer could not be star...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android Designer ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: 15.4
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-18 17:49 UTC by Cody Beyer (MSFT)
Modified: 2017-09-01 10:10 UTC (History)
9 users (show)

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


Attachments
logs (4.14 KB, application/x-zip-compressed)
2017-07-26 18:01 UTC, Ben Beckley
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 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 Cody Beyer (MSFT) 2017-07-18 17:49:52 UTC
# Description

The following warning is presented upon project creation for an Android project in VS 2017. However, Java is configured correctly, and the designer is operational

https://www.dropbox.com/s/h41q7wvke3572f2/work.png?dl=0

# Steps to Reproduce

1. Open Visual Studio 2017
2. Create Android Project
3. Observe Warnings pad

# Expected Results

No warning, as Java is in ship shape

# Actual Results

Warning is displayed

# Versions

Microsoft Visual Studio Enterprise 2017 Preview (2)
Version 15.3.0 Preview 4.0
VisualStudio.15.Preview/15.3.0-pre.4.0+26711.1
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-60000-00001-AA467
Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017   00369-60000-00001-AA467
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA467
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA467
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA467
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00629.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30629.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30629.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30623.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.2.9000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50628.2

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio tools for CMake   1.0
Visual Studio tools for CMake

Visual Studio Tools for Universal Windows Apps   15.0.26711.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.IoT   1.0
Package with IoT components for Visual Studio

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

WebJobs Tools v1.0.0   __RESXID_PRODUCTVERSION__
WebJobs Tools v1.0.0

Xamarin   4.6.0.560 (33bfa20)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.0.15 (a93c6f4)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.0.14 (bf350ba)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Prashant [MSFT] 2017-07-19 05:08:41 UTC
@Cody I am not able to reproduce this issue with the same installation. 
Could you attach the Xamarin logs from the Visual Studio?
Comment 2 Ben Beckley 2017-07-26 18:01:39 UTC
Created attachment 23823 [details]
logs

I too encountered this. Attaching the logs from when it happened.

env info: https://gist.github.com/BenBeckley/7e38b680fe0c71d4af536304ead0ff7e
Comment 3 Ben Beckley 2017-07-26 18:08:19 UTC
And for what it's worth, I have the JDK 1.8.0_131
Comment 4 Ben Beckley 2017-07-26 19:12:54 UTC
Installed another instance of VS2017 on a different machine and ran into this again.

I restarted VS, and open an Android project again, but I did not see the warning. It seems as if this is occurring the first time you run VS & Xamarin after a fresh install.
Comment 5 Bret Johnson [MSFT] 2017-08-25 23:54:43 UTC
I also repro'ed the issue on first launch post install, but, like Ben, it worked for me when VS was launched subsequent times.

I see the same error in the log that Ben did:
[2017-07-26 12:48:17.0] ERROR: : Java version check failed
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Xamarin.AndroidDesigner.Java.JavaProcessFactory.RunProcess(String filename, String arguments, String& stdout, String& stderr) in C:\d\lanes\5156\862a7a68\source\xamarinvs\External\md-addins\MonoDevelop.MonoDroid\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner.Java\JavaProcessFactory.cs:line 170
   at Xamarin.AndroidDesigner.Java.JavaProcessFactory.CheckJavaVersion(String javaSdkPath, Version minimumJavaVersion, String& errorMessage) in C:\d\lanes\5156\862a7a68\source\xamarinvs\External\md-addins\MonoDevelop.MonoDroid\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner.Java\JavaProcessFactory.cs:line 133

Though Java is there (and worked when I ran it from the command line).


Pierce said it failed persistently for him, not just on first launch. He's going to try to repro that, as that's of course a much more serious issue.
Comment 6 Alan McGovern 2017-08-28 11:24:09 UTC
The relevant code for us is: https://github.com/xamarin/designer/blob/75f4e00911e92aacd6d4fc1c5727bc7b1abb7581/Xamarin.Designer.VisualStudio/src/VisualStudio.Android.Designer/MonoAndroidDesignerService.cs#L45-L102

If things are permanently failing then the most likely explanation is that the XVS extension is not invoking the events when the java path changes, or we're getting the wrong path when we query the path.

If this is a temporary failure then maybe the issue is going away once XVS invokes the events and passes on the correct java path. I don't know which part of the codebase is responsible for clearing error messages from that panel though.
Comment 8 Alan McGovern 2017-08-28 14:31:34 UTC
I'm hoping pierce can tell us if it's a permanet issue or temporary issue. It *sounds* like it's just a warning that isn't being cleared from the panel but it's not clear.
Comment 9 Bret Johnson [MSFT] 2017-08-28 15:24:15 UTC
I have a saved Parallels VM snapshot that reproduces it. It looks like it's just a warning that's not cleared.

Here's what I see:
After installing VS, you can launch it a few times, not doing anything Android related.
But the first File / New Project to create an Android project shows the warning. Again, the designer still actually works, but the warning is there saying it doesn't.
After VS is closed and re-launched, the warning is gone and doesn't show up again.
Comment 11 Alan McGovern 2017-09-01 10:06:20 UTC
This doesn't happen with master builds. I removed all of my java's and installed only using willow and it works as expected. If this can be reproduced in master then please re-open and we'll have to investigate more.

The integration has changed drastically between master and all previous releases so it's possible this was indirectly fixed already.