"Connection to the layout renderer failed" in XS 5.7 and XamarinVS 3.9

naortornaortor USMember
edited January 2015 in Xamarin.Android

Hey,

got this error after updating Xamarin Studio,
any idea how to fix it?

thanks,

Naor

Posts

  • mhutchmhutch USMember, Xamarin Team Xamurai

    You may need to update the Android SDK.

  • naortornaortor USMember

    Hey,

    thanks but I have the latest SDK version.

  • NeilBensonNeilBenson GBMember

    Same problem here.
    Have updated all tools and packages in the SDK Manager.

    I noted that when this has occurred previously that the solution is to downgrade Android SDK Tools to version 23.02 ( from version 24.02) I tried this but that then generates an error dialog, "The file cannot be opened. Object reference not set to an instance of an object".

    Using Xamarin 5.7, Windows 8 64 Bit.
    SDK Tools : 21
    Android 5.0.1 (API 21)

    Thanks
    Neil

  • JeremieLavalJeremieLaval USXamarin Team Xamurai
    edited January 2015

    @naortor‌ can you fill a bug report on https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin Studio (with component "Android Designer") and attach your IDE logs (in Xamarin Studio you can open the log directory with Help > Open Log Directory).

    Thanks

  • naortornaortor USMember

    done

  • WintermuteWintermute USMember
    edited January 2015

    Same issue here. Just auto-updated to and got exactly the same problem. Reboot did not help.

    image

    Closing and re-opening the Main.axml adds the following log entries in Ide.2015-01-15__01-42-39.log:

    ERROR [2015-01-15 01:48:28Z]: Gtk-Critical: gtk_container_remove: assertion 'GTK_IS_TOOLBAR (container) || widget->parent == GTK_WIDGET (container)' failed
    Stack trace: 
       bei Gtk.Container.gtk_container_remove(IntPtr raw, IntPtr widget)
       bei Gtk.Container.Remove(Widget widget)
       bei Xwt.GtkBackend.CanvasBackend.RemoveChild(IWidgetBackend widget)
       bei Xwt.Canvas.RemoveChild(Widget widget)
       bei Xamarin.Designer.XwtDesignerSurfaceRenderer.ChildRemoveDisposable.Dispose()
       bei Xamarin.Designer.DesignerSurface.HandleReadyStatusChanged(Object sender, EventArgs e)
       bei System.EventHandler.Invoke(Object sender, EventArgs e)
       bei Xamarin.Designer.DesignerSession.OnReadyStatusChanged()
       bei Xamarin.AndroidDesigner.AndroidDesignerSession.OnReadyStatusChanged()
       bei Xwt.Application.<>c__DisplayClass5.b__4()
       bei Xwt.GtkBackend.GtkEngine.<>c__DisplayClass1.b__0(Object param0, EventArgs param1)
       bei Gtk.Application.InvokeCB.Invoke()
       bei GLib.Timeout.TimeoutProxy.Handler()
       bei Gtk.Application.gtk_main()
       bei Gtk.Application.Run()
       bei MonoDevelop.Ide.IdeApp.Run()
       bei MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options)
       bei MonoDevelop.Ide.IdeStartup.Main(String[] args, IdeCustomizer customizer)
       bei Xamarin.Startup.MainClass.Main(String[] args)
    
    INFO [2015-01-15 01:48:32Z]: Error occurred during initialization of VM
    INFO [2015-01-15 01:48:32Z]: Could not reserve enough space for object heap
    INFO [2015-01-15 01:48:32Z]: Error: Could not create the Java Virtual Machine.
    INFO [2015-01-15 01:48:32Z]: Error: A fatal exception has occurred. Program will exit.
    ERROR [2015-01-15 01:48:32Z]: Connection failed
    System.Exception: Could not start java process
       bei Xamarin.AndroidDesigner.JavaProcessConnection.DoConnect()
    ERROR [2015-01-15 01:48:33Z]: Could not update jumplists
    System.InvalidOperationException: The file type is not registered with this application.
       bei Microsoft.WindowsAPICodePack.Taskbar.JumpList.AppendCustomCategories()
       bei Microsoft.WindowsAPICodePack.Taskbar.JumpList.Refresh()
       bei MonoDevelop.Platform.JumpList.UpdateJumpList()
       bei MonoDevelop.Platform.JumpList.OnUpdateTimerEllapsed(Object sender, EventArgs args)
    
    
  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    For reference, naortor's bug report is here:
    https://bugzilla.xamarin.com/show_bug.cgi?id=26026

  • NeilBensonNeilBenson GBMember

    Running Xamarin studio again - it all started working again. (Using version 24 of platform tools in the Android SDK). Quite surprised by this as I've not changed anything. Could be a tricky bug to track down.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited January 2015

    Based on some preliminary reports from other users ([1], [2]), it sounds like updating to Java JDK version 1.8 might be an acceptable workaround. It might be important to use the 64-bit version of JDK 1.8 for this workaround to be successful. (As per [2], you can also check whether you have a _JAVA_OPTIONS environment variable set.)

    Duplicate threads (now closed to help consolidate discussion onto this thread):

  • DavidCarriganDavidCarrigan USMember
    edited January 2015

    Did not work @BrendanZagaeski

  • Updating the Options/SDK Locations/Android, Java SDK (JDK) setting to use the 1.8.0_25 x64 version fixed it for me. I was previously pointed to the 32-bit version of 1.7.0_55.

  • @Ivisi what is Options/SDK Locations/Android, Java SDK (JDK) setting and where is it? Everyone is exhaustingly vague. Unless you're talking about XS and not VS on Windows.

  • I had the same issue as the OP did in XS, so that's what I was referring to.

  • Ok sorry, my thread was closed as a "duplicate" of this one. So I'm kind of stuck here in a partially unrelated thread. Beyond frustrated.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited January 2015

    @DavidCarrigan‌, I've temporarily reopened the other thread. One important diagnostic step to determine whether the problem you're seeing is any different from the problem reported in this thread is to check whether you are seeing the following error message in the log files [1]:

    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Error: Could not create the Java Virtual Machine

    (This error message might be broken up by other error messages.)

    [1]: Log file locations
    Visual Studio: %LOCALAPPDATA%\Xamarin\Log\devenv*.log
    Xamarin Studio on Windows: %LOCALAPPDATA%\XamarinStudio-5.0\Logs
    Xamarin Studio on Mac: $HOME/Library/Logs/XamarinStudio-5.0

    If the error message does match

    If you are seeing this error message, then the underlying problem is likely the same as the problem other users are reporting on this thread. In that case, you can try:

    1. Install Java JDK 1.8 (64-bit).
    2. 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.

    If the error message does not match

    If you see a different error message in the log files, or no promising error messages, then (1) you can attach back your log files (either on this forum thread or on your existing support email case), and (2) we can follow up via a desktop sharing session. I'll pick up on your email support thread to help coordinate that.

    Thanks in advance for the follow-up!


    EDIT 12:44 PM: Add missing line breaks in the error message

  • DiogoVSDiogoVS USMember

    Thanks @BrendanZagaeski,

    I work with Visual Studio 2013 and this work for me...

  • KatherineDaltonKatherineDalton USMember, University

    Thanks! Installed Java JDK 1.8 (64-bit) and uninstalled Java JDK 1.7 and it's working now. Using VS on Windows.

  • JoeRock11JoeRock11 USMember

    @BrendanZagaeski thank you, uninstalling JDK 1.7 worked for me.

  • BertusvanZylBertusvanZyl USMember

    I also created a thread about this problem.
    http://forums.xamarin.com/discussion/30890/connection-to-the-layout-rendere-failed-this-may-be-caused-by-misconfiguration-of-java#latest
    You can close it as a duplicate too. Although the fact that you did not already close it as a duplicate leads me to believe that no one has paid any attention to it.

    Anyways, mine is working now. I had to uninstall all versions of Java SDK below 1.8, and reboot. Do you have an ETA on a fix for this? It will not be possible for everyone to uninstall older versions due to dependencies on older versions.

  • YohanAttalYohanAttal FRMember
    edited January 2015

    Well this is damn awkward.

    I finally decided to update Xamarin and here I am on for a treat ....

    First after Updating Xamarin Studio and then Xamarin Android & iOS, I cannot open a axml file -> "Object reference not set to an instance of an object."

    So I uninstalled everything (all Xamarin) and then reinstalled them. Updated SDK as well.
    And now ? Well, I have the layout renderer problem. If I downgrade the SDK tools, I have the first error I mentioned.

    This is seriously grave. I have an expensive licence and I cannot even use the product ? DO SOMETHING !

    Note : I also tried the solution with JDK 1.8. Nope, it does not help a bit.

  • JannaMcLaughlinJannaMcLaughlin USMember, Xamarin Team, University Xamurai

    @YohanAttal‌ This bug is being addressed. You can find the report here: https://bugzilla.xamarin.com/show_bug.cgi?id=26026

  • YohanAttalYohanAttal FRMember

    @JannaMcLaughlin thank you. I managed to find out how to switch to JDK 1.8 64 bits. I first did not know where to find the option to do so, I just assumed downloading that JDK and removing any previous versions would work.

    So now it does seem to work with last version of Android SDK's tools !

  • Works for me with Java 1.8 32bits as well (and no other version of java installed).

  • yromulusyromulus GBMember

    I was getting the layout renderer failed message after the update too - I tend to edit the xml directly anyway so it wasn't always a problem. However, most of the time, once the renderer error had been shown the solution would never build - it would get stuck in an infinite loop "building". The only way out was to exit the application. If you'd made changes it was 50/50 whether these would be saved.

    Changing to the later SDK option having upgraded to the latest SDK tools worked for me but for anyone who does this it's perhaps worth knowing that I had to do a complete clean and rebuild - just rebuilding gives deployment errors.

    So frustrating sometimes...

  • FernandoAlbernazFernandoAlbernaz USMember
    edited January 2015

    Thank you very much @BrendanZagaeski‌ - that solve my problem

  • @BrendanZagaeski, I followed your advice and installed Java JDK 1.8, uninstalled all Java versions below 1.8 (in my case 1.7u71), restarted the computer. And now my VS 2013 on windows freezes while opening the solution. It is in Not responding state for like 15 minutes now.

  • Marcin.2612Marcin.2612 USMember

    I my case I've change system envirement Path. Before change is was
    C:\Program Files\Java\jre1.8\bin
    and I change it for
    C:\Program Files\Java\jre1.8.0_25\bin.

    Xamarin Studio or Visial restart and it was helped my.

  • DavidBoltonDavidBolton GBMember ✭✭
    edited January 2015

    I had the problem (Windows 8.1, visual studio) and updated the jdk to 1.8. I already had the 64 bit 1.8 jre version 31. I found something interesting. After the JDK install (and removal of the 1.7) , the only java entry in the path was this: C:\ProgramData\Oracle\Java\javapath; Looking in that folder i saw three symlinks.

    I manually added the jre path to PATH and rebooted and it worked.

    image

  • TerenceMakamureTerenceMakamure ZWMember
    edited February 2015

    Thanks @Brendan_Zagaeski. Problem solved with update to Java 1.8 even in 64Bit. I am using Xamarin Studio by the way.

  • Could someone provide links to the actual versions of the Java to install ? I am running Windows 7...

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited February 2015

    Thanks again for the reports and the confirmations about improvements with Java 1.8. I have started a new thread to put a more complete discussion of the diagnostic steps and the possible workarounds at the top of the thread. The new thread also includes a link to Oracle's Java JDK download page.

    As it turns out I was mistaken earlier when I mentioned the requirement to uninstall other versions of Java. That behavior has been improved in recent versions of Xamarin. The new thread includes updated workaround steps that will allow you to keep multiple JDK versions installed side-by-side.

    Here's the new thread:
    http://forums.xamarin.com/discussion/32365/connection-to-the-layout-renderer-failed-in-xs-5-7-and-xamarinvs-3-9

    I'll close this thread for now to help consolidate any further questions about the workarounds or the status of the problem on the new thread.

  • luckysimmobileluckysimmobile THMember

    xamarin is good webboard and Nicesimcard Click>>>[url=http://www.scnumber.com/]Scnumber[/url]

  • luckysimmobileluckysimmobile THMember

    is good webboard and Nicesimcard Click>>>[url=http://www.scnumber.com/]Scnumber[/url]

This discussion has been closed.