Forum Visual Studio


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

"java.exe" exited with code 1

MarcoSeraphinMarcoSeraphin DEMember, University


I am facing with this Java error compiling my Android project with current stable Xamarin version on Windows 8 with VisualStudio 2013.

I have included the Google Play Services (Jelly Bean) component in the project because I use Google AdMob in my App.

On the Mac with Xamarin Studio the project compiles and runs without errors. I just had to increase the Java heap.

I tried to increase the Java heap in the project properties, updated my local Java installation, set the API Level to 16.....but nothing helps.

I always get the Java.exe exited with code 1 error.

Any ideas ? Can anyone help me ?




  • prashantvcprashantvc USXamarin Team Xamurai

    Could you post the complete build log? It will help us to troubleshoot the issue.

  • MarcoSeraphinMarcoSeraphin DEMember, University

    Hello Prashant,

    thanx for your fast reply. And you are right, I forgot further information.
    I set the build verbose options to details, so a lot of line, but I hope it helps.
    I attached a file with the build output.

    Thank you,


  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai


    The build log shows this error:

    Invalid maximum heap size: -Xmx512MB

    Hopefully the fix will as easy as changing "MB" to "M" in your project settings.

    As a test, you can try running java on the command line:

    "C:\Program Files (x86)\Java\jdk1.6.0_39\bin\java.exe" -Xmx512M

  • MarcoSeraphinMarcoSeraphin DEMember, University

    Hi Brendan,

    I should use my eyes are completely right. Just "M" instead of "MB".
    No it I got no error compiling.

    BUT, if I could ask this additionally. I get the well know error concerning the Android SDK version 22.6.3.

    If I open an Android layout file in the Android GUI designer I get the following error:

    "Disconnected from layout renderer. Please close and open the file again".

    I have installed the Android SDK Tools 22.6.3.

    Do I have to downgrade ?
    I have installed the latest java version and the latest Xamarin VisualStudio stable version.
    (In Xamarin Studio on the Mac I do not face these problems)

    Thanx again,


  • MarcoSeraphinMarcoSeraphin DEMember, University

    Hi Brendan,

    I made a downgrade to the Android SDK Tools 22.6.2 as recommended in the forum.
    Now the layout renderer error is gone.

    So far so good. Will Xamarin VS work with version 22.6.3 ?



  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    Glad you got things up and running! Yes indeed, Xamarin Studio version 4.2.5 now supports Android SDK Tools 22.6.3, and that fix will be brought over to Visual Studio too, likely in the next update.

  • blazeblaze USMember ✭✭

    I have similar mistake

    1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1180,3): error MSB6006: "java.exe" exited with code 1.

    but increasing heap to 512M is not helping

    1 hour ago I could make release all was good. Then I have decided to install Android Studio (to use its axml designer). And installed JDK 1.7 64 bit. Android Studio worked. VS releas not anymore. Then I have deinstalled all java footprints and install only JDK 1.7 - the same java.exe error. Then deinstall all java footprints and install JDK 1.6 - the same.

    How should I solve it, tell me please.

    Here is VS info.

    Microsoft Visual Studio Premium 2012
    Version 11.0.61030.00 Update 4
    Microsoft .NET Framework
    Version 4.5.50938

    Installed Version: Premium

    LightSwitch for Visual Studio 2012 04941-004-0043007-02509
    Microsoft LightSwitch for Visual Studio 2012

    Team Explorer for Visual Studio 2012 04941-004-0043007-02509
    Microsoft Team Explorer for Visual Studio 2012

    Visual Basic 2012 04941-004-0043007-02509
    Microsoft Visual Basic 2012

    Visual C# 2012 04941-004-0043007-02509
    Microsoft Visual C# 2012

    Visual C++ 2012 04941-004-0043007-02509
    Microsoft Visual C++ 2012

    Visual F# 2012 04941-004-0043007-02509
    Microsoft Visual F# 2012

    Visual Studio 2012 Code Analysis Spell Checker 04941-004-0043007-02509
    Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    ASP.NET and Web Tools 2012.3.41009
    Microsoft Web Developer Tools contains the following components:
    Support for creating and opening ASP.NET web projects
    Browser Link: A communication channel between Visual Studio and browsers
    Editor extensions for HTML, CSS, and JavaScript
    Page Inspector: Inspection tool for ASP.NET web projects
    Scaffolding: A framework for building and running code generators
    Server Explorer extensions for Windows Azure Web Sites
    Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

    Color Theme Designer 1.0
    Designer for creating new color themes

    NuGet Package Manager 2.8.50313.31
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit

    PreEmptive Analytics Visualizer 1.0
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    SQL Server Data Tools 11.1.20627.00
    Microsoft SQL Server Data Tools

    Xamarin for Visual Studio (b3acb09afda91828e5bd48308ac8e7433d30f330)
    Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

    Xamarin.Android (7f0e3d3cfb9b36570e8d7862a33d0310238c814d)
    Visual Studio plugin to enable development for Xamarin.Android.

    Xamarin.iOS (b3acb09afda91828e5bd48308ac8e7433d30f330)
    Visual Studio extension to enable development for Xamarin.iOS

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    @blaze, thanks for the report! When you get a chance, if you wouldn't mind sending the following additional information in to [email protected], that would be perfect:

    • Your current Android SDK version information, for example from the Android SDK Manager, or from Xamarin Studio under "Help -> About Xamarin Studio -> Show Details -> Copy Information"
    • The full diagnostic build output from the Output window.
    • If you like, your whole solution, cleaned and zipped up.

    With some luck, the diagnostic build output might point you directly to a fix.

  • blazeblaze USMember ✭✭

    Thanx, Brendan for the help and for the fast answer....
    I wasn't be able to enjoy this mistake inside of diagnostic debug window, cause after CLEANING and REBUILDING the project all has just started to work!

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    @blaze‌ Excellent. Glad to hear it's working now!

  • heemanshubhallaheemanshubhalla INMember ✭✭

    i have suffered from this error and finally i decided to sit and fix it I have put a blog with some explantion and solution steps on my blog I have put the solution that worked for me

  • VahedMamqaderiVahedMamqaderi USMember

    I have same problem. I increased the max HeapSize to 1G but it didn't work until I increase to 4G But now, I have new error:

    1>COMPILETODALVIK : error : Could not create the Java Virtual Machine.
    1>COMPILETODALVIK : error : A fatal exception has occurred. Program will exit.

    How I can solve it?

  • David.RettenbacherDavid.Rettenbacher ATMember ✭✭


  • FranciscoGGFranciscoGG ESMember ✭✭


    I am getting the same error:

    Error 26 "java.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 2118 3 Elfo.VisionShop.Droid

    And here is the output:

    8> Can't read [C:\Users\FranciscoJavier\AppData\Local\Android\android-sdk\platforms\android-24\android.jar] (Can't process class [java/nio/charset/CharsetDecoder.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
    8> at proguard.InputReader.readInput(
    8> at proguard.InputReader.readInput(
    8> at proguard.InputReader.readInput(
    8> at proguard.InputReader.execute(
    8> at proguard.ProGuard.readInput(
    8> at proguard.ProGuard.execute(
    8> at proguard.ProGuard.main(
    8> Caused by: Can't process class [java/nio/charset/CharsetDecoder.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))
    8> at
    8> at
    8> at
    8> at
    8> at
    8> at proguard.InputReader.readInput(
    8> ... 6 more
    8> Caused by: java.lang.UnsupportedOperationException: Unsupported class version number [52.0] (maximum 51.0, Java 1.7)
    8> at proguard.classfile.util.ClassUtil.checkVersionNumbers(
    8> at
    8> at proguard.classfile.LibraryClass.accept(
    8> at
    8> ... 11 more
    8> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
    8>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2118,3): error MSB6006: "java.exe" exited with code 1.
    8>Done executing task "Proguard" -- FAILED.

    What can I do?

  • Gigex42Gigex42 USMember ✭✭✭✭

    Having the same error.

    Also getting error in the output:
    2> warning: C:\Users...\AppData\Local\Android\android-sdk\platforms\android-24\android.jar(android/...): major version 52 is newer than 51, the highest major version supported by this compiler.
    2> It is recommended that the compiler be upgraded.

  • NealCulinerNealCuliner USBeta ✭✭✭

    JDK 1.7 vs. 1.8 I believe is causing this - you may have 1.8 and Xamarin.Android I believe is bound to 1.7 (proguard)

  • EdgarPerezEdgarPerez DOMember

    In my case the ProGuard was the cause of the compilation fail.

  • batmacibatmaci DEMember ✭✭✭✭✭

    this happens sometimes when there isnt enough space on the disk of the emulator or phone

  • PaulAdinamPaulAdinam Member

    I have applied every solutions I have seen so far but still, my project wont build with proguard enabled.

    error "java.exe" exited with code 1..

    Any help will be appreciated. Thanks

  • batmacibatmaci DEMember ✭✭✭✭✭

    One another reason this happens is if you set a singing key path on android settings and keystore cannot be found on that path. It happened to me today after changing to a new PC and path was empty.

  • Hi .. I had the same error and it is due to the signature of the android package keystore

  • AboghrisAboghris USMember ✭✭

    After updating Xamarin.Forms to The latest one in VS 2017 , i start having "MSB6006: "java.exe" exited with code 1. " in debug and Release Mode .

  • batmacibatmaci DEMember ✭✭✭✭✭

    4.5 have a lot of problems registered in the github issues. please check there. there might be your issue. otherwise you may create one.

Sign In or Register to comment.