Xamarin.Android.Common.targets(1883,3): error MSB6006: "java.exe" exited with code 1

Hello,
I'm new to xamarin. I made a new Android Project and written a bit code. I Got the Error MSB6006: "java.exe" exited with code 1. So i started a complete new project and build it, but still the same error. I Know there are a lot of post about this kind of error but none of the given tips there helped.
I have Windows 7 Enterprise, Visual Studio 2015 with Xamarin Starter and the JDK 7u79. I have enabled the Diagnostic output, but it looks rather normal to me. the error MSB6006 is the only error/warning i get.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1883,3): error MSB6006: "java.exe" exited with code 1. 1> DexOutputs: (TaskId:150) 1>Done executing task "CompileToDalvik" -- FAILED. (TaskId:150) 1>Done building target "_CompileToDalvik" in project "App2.csproj" -- FAILED.: (TargetId:127)
I already tried using the 1G Java Max Heap Size. But I think the fault is in the used JRE beacause it lists the JRE8 and not 7, but i don't know if the JRE plays a role in the build process.
I Don't know if this is connected, but i get the Messages "Could not find schema information for the element manifest/uses-sdk/application and for the attribut package.

Thanks for your Help!

Best Answer

Answers

  • Mr_ChaosMr_Chaos USMember

    OK, i now have reinstalled Xamarin with the Xamarin installer instead of the Visual Studio installer. I made the JRE7 my primary JRE (I don't know if this was even necessary). And i tried it also with Xamarin Studio but i still get an error and i think i found out what really was causing it. It don't know the output extension: obj\Debug\android\bin. But i have looked, this path exist.
    1> C:\Program Files (x86)\Java\jdk1.7.0_79\\bin\java.exe -Xmx1G -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\android-4.2.2\\lib\dx.jar" --no-strict --dex --output=obj\Debug\android\bin obj\Debug\android\bin\classes "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar" (TaskId:142) 1> unknown output extension: obj\Debug\android\bin (TaskId:142) 1> usage: (TaskId:142) 1> dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals] (TaskId:142) 1> [--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no-strict] (TaskId:142) 1> [--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-width=<n>] (TaskId:142) 1> [--dump-method=<name>[*]] [--verbose-dump] [--no-files] [--core-library] (TaskId:142) 1> [--num-threads=<n>] [--incremental] [--force-jumbo] (TaskId:142) 1> [<file>.class | <file>.{zip,jar,apk} | <directory>] ... (TaskId:142) 1> Convert a set of classfiles into a dex file, optionally embedded in a (TaskId:142) 1> jar/zip. Output name must end with one of: .dex .jar .zip .apk. Positions (TaskId:142) 1> options: none, important, lines. (TaskId:142) 1> dx --annotool --annotation=<class> [--element=<element types>] (TaskId:142) 1> [--print=<print types>] (TaskId:142) 1> dx --dump [--debug] [--strict] [--bytes] [--optimize] (TaskId:142) 1> [--basic-blocks | --rop-blocks | --ssa-blocks | --dot] [--ssa-step=<step>] (TaskId:142) 1> [--width=<n>] [<file>.class | <file>.txt] ... (TaskId:142) 1> Dump classfiles, or transformations thereof, in a human-oriented format. (TaskId:142) 1> dx --find-usages <file.dex> <declaring type> <member> (TaskId:142) 1> Find references and declarations to a field or method. (TaskId:142) 1> declaring type: a class name in internal form, like Ljava/lang/Object; (TaskId:142) 1> member: a field or method name, like hashCode (TaskId:142) 1> dx -J<option> ... <arguments, in one of the above forms> (TaskId:142) 1> Pass VM-specific options to the virtual machine that runs dx. (TaskId:142) 1> dx --version (TaskId:142) 1> Print the version of this tool (1.7). (TaskId:142) 1> dx --help (TaskId:142) 1> Print this message. (TaskId:142) 1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1886,3): error MSB6006: "java.exe" exited with code 1. 1> DexOutputs: (TaskId:142)

  • YkshLeoYkshLeo USMember ✭✭✭✭

    Xamarin Studio --> Tools --> Options --> Projects --> SDK Locations --> Android --> Android SDK

    Make sure that the SDK Location path is correct.

  • Mr_ChaosMr_Chaos USMember

    Yes, that path is correct and also that of the JDK and the Android NDK, but anyway thanks for the reply

  • Mr_ChaosMr_Chaos USMember

    No these are both Deployment Errors. My error was a build error. But it works now as written in my last post. I don't know why, but it works and that it what matters.

  • Vikram_BVikram_B USMember ✭✭

    @Mr_Chaos

    Please mark the question as answered so that others will be able to see the new issues here.

  • Mr_ChaosMr_Chaos USMember

    @vikramboya
    When i look at it in my Thread Overview it is marked as answered.
    But if this is only visible to me, how do i put this, so everyone can see it as answered. The Option "Did this answer your question?..." only appear at other posts. Can i do this with my own post too, which has the answer to my problem.

  • Vikram_BVikram_B USMember ✭✭

    @Mr_Chaos

    Thanks Oke ........Happy coding ;)

  • Anil.ApexAnil.Apex USMember ✭✭

    @Mr_Chaos I added all registry entries which couldn't be found.
    How to add them?

Sign In or Register to comment.