Anass
Anass

Reputation: 51

Connection to the layout renderer failed. This may be caused by misconfiguration of Java

Connection to the layout rendere failed. This may be caused by misconfiguration of Java

When i tried to run Xamarin and start developing app, opening layout files gives me the error:

enter image description here

Xamarin misconfiguration of java

Upvotes: 4

Views: 8444

Answers (7)

None of the answers here worked for me. I'm running Visual Studio 2022 Preview 2 at the moment and I was getting the same error. I tried installing x32 bit version of JDK 11, and that didn't help.

What worked finally, after going through https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/openjdk, was to change the path to Java Development Kit Location (Tools > Options > Xamarin > Android Settings) to C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25.

Upvotes: 1

Nati
Nati

Reputation: 1

Upgrade Android SDK. You can do this by downloading the recent version. If you already have installed Android Studio, the Android SDK will be installed. So after Downloading copy the tools folder and paste it to

c:\users\{your user name}\AppData\Local\Android\sdk

Upvotes: 0

user1745053
user1745053

Reputation: 41

I just had this issue with a new Visual Studio 2017. VS was referencing the 64bit JDK instead of the 32bit one.

Just go to

Tools -> Options -> Xamarin -> Android Settings

and change to point to the x86 JDK which is in

Program Files (x86)\Java 

rather than

Program Files\Java.

Upvotes: 4

Tayormi
Tayormi

Reputation: 1405

Simply update your Xamarin Studio. I got mine fixed by doing this

Upvotes: 0

Burak Ogutken
Burak Ogutken

Reputation: 690

uninstall xamarin, android sdk and all java JDK after reinstall xamarin installer will fix this headache

Upvotes: 1

Raktim Biswas
Raktim Biswas

Reputation: 4077

Gone through a few articles and I found a solution as most users said that it worked for them.

Anyway, try this:

  1. Uninstall Java JDK 1.6 and Java JDK 1.7 using the "Programs and Features" control panel. On Windows, Xamarin will automatically pick version 1.6 or 1.7 instead of version 1.8 if either of those older versions are installed.
  2. Install the Java JDK 1.8 (64-bit)

Upvotes: 7

SushiHangover
SushiHangover

Reputation: 74144

Check your Java installation to ensure that mets Xamarin's requirements. Following the information below to ensure that at least Java 1.7 is properly installed.

Note: If 1.7 is installed correctly and in the correct location and it is still not working, you can try upgrading to Java 1.8 as that appears to have solved this problem on others setups.


Installing the Java SDK (JDK)

It is essential to install the 32-bit version of the Java JDK even if you're using 64-bit Windows. It is also important that v1.7 of the Java JDK is installed (although it is fine to have 1.8 or newer installed at the same time).

It is recommend that the Java JDK is placed in the directory C:\Program Files (x86)\Java. This is the default location, and is where your IDE will check to see if it is installed.


http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

enter image description here

Upvotes: 1

Related Questions