title: Xamarin: Error when loading layout axml file in android
body: <p>When I create a axml file and try to open it in designer view for android layout I get the followign error message:</p>
  
  <pre><code>"Connection to the layout renderer failed. This may be caused by a misconfiguration of Java"
  </code></pre>
  
  <p>and with the following stack trace:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: com/android/utils/ILogger
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 7 more
  Error: A JNI error has occurred, please check your installation and try again
  Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
  Exception in thread "main" 
  </code></pre>
  
  <p>What I have tried to do so far is reinstalling the Java JDK, upgrading it from 1.7 to 1.8 as well as downgrading, always with 64-bit version. Tried to introduce the environmental variable _JAVA_OPTIONS and change it do have the value -XX:MaxPermSize=256m, but did not help.</p>
  
  <p>There were other solutions but they were applicable only for xamarin studio on iOS and as I am using xamarin integration on windows with Visual Studio 2015, they did not apply for.</p>
  
  <p>So my question is, are there any solution to this problem?</p>
  
  <p>P.S Please say if I did not provide enough information or was no clear.</p>
  
  <p>Thank you.</p>
  
  <p><strong>UPDATE 30/05/2019</strong>
  Probably a little too late, however I have managed to figure out this problem back in the days by matching the Java and Android sdk versions. It seemed one version of java was not very happy with particular android sdk version and vice verse, so just try to install a different one until they match up.</p>