Bug 34643 - java.exe exited with code 1 - android wear 1.3.0.0
Summary: java.exe exited with code 1 - android wear 1.3.0.0
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-10-07 13:54 UTC by microcircuitssigloxxi
Modified: 2015-11-04 08:06 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Log (2.28 MB, text/plain)
2015-10-26 07:02 UTC, microcircuitssigloxxi
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description microcircuitssigloxxi 2015-10-07 13:54:14 UTC
After update project to xamarin.android.Wear 1.3.0.0 doesn't build.
Error java.exe exited with code 1
Comment 1 Jonathan Pryor 2015-10-07 14:10:04 UTC
Could you please provide diagnostic build output?

http://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Diagnostic_MSBuild_Output

Have you set the $(JavaMaximumHeapSize) property?

http://developer.xamarin.com/guides/android/under_the_hood/build_process/#EnableProguard
Comment 2 microcircuitssigloxxi 2015-10-26 07:02:21 UTC
Created attachment 13522 [details]
Log
Comment 3 microcircuitssigloxxi 2015-10-26 07:03:06 UTC
Same problem using xamarin.android.Wear 1.3.0.1

$(JavaMaximumHeapSize) --> 1G

Regards,
Comment 4 Jonathan Pryor 2015-10-29 15:37:37 UTC
Thank you for the build output. From it, we can see:

>        C:\Program Files (x86)\Java\jdk1.7.0_79\\bin\java.exe -jar C:\Users\development\AppData\Local\Android\android-sdk\tools\proguard\lib\proguard.jar -include C:\Users\development\AppData\Local\Android\android-sdk\tools\proguard\proguard-android.txt -include obj\Release\proguard\proguard_xamarin.cfg -include obj\Release\proguard\proguard_project_references.cfg -include obj\Release\proguard\proguard_project_primary.cfg "-injars 'obj\Release\proguard\__proguard_input__.jar';'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v5.0\mono.android.jar';'obj\Release\__library_projects__\Xamarin.Android.Wearable\library_project_imports\classes.jar';'C:\Users\development\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\classes.jar';'C:\Users\development\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\libs\internal_impl-23.0.1.jar';'C:\Users\development\AppData\Local\Xamarin\Android.Support.v7.RecyclerView\23.0.1.3\embedded\classes.jar';'C:\Users\development\AppData\Local\Xamarin\Android.Wearable\1.3.0\embedded\classes.jar'" "-libraryjars 'C:\Users\development\AppData\Local\Android\android-sdk\platforms\android-22\android.jar'" -outjars "obj\Release\proguard\__proguard_output__.jar" 
...
>         Note: duplicate definition of program class [android.support.wearable.BuildConfig]
...
> PROGUARD : warning : can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])
> java.io.IOException: Can't write [C:\Users\development\Documents\Visual Studio 2013\Projects\adasoft\flashapp\Client\Mobile\View\Android\trunk\Wearable\obj\Release\proguard\__proguard_output__.jar] (Can't read [C:\Users\development\AppData\Local\Xamarin\Android.Wearable\1.3.0\embedded\classes.jar] (Duplicate zip entry [classes.jar:android/support/wearable/BuildConfig.class]))
> 	at proguard.OutputWriter.writeOutput(OutputWriter.java:264)
> 	at proguard.OutputWriter.execute(OutputWriter.java:160)
> 	at proguard.ProGuard.writeOutput(ProGuard.java:372)
> 	at proguard.ProGuard.execute(ProGuard.java:153)
> 	at proguard.ProGuard.main(ProGuard.java:492)

It looks like Proguard execution is reporting errors and failing, which is something that setting $(JavaMaximumHeapSize) won't help with.

It looks like a .jar is being included multiple times, causing the same types to be included multiple times.

In particular, from the java.exe proguard.jar command-line, these looks potentially duplicative:

> obj\Release\__library_projects__\Xamarin.Android.Wearable\library_project_imports\classes.jar
> C:\Users\development\AppData\Local\Xamarin\Android.Wearable\1.3.0\embedded\classes.jar

Especially since the first "Note: duplicate definition" message is *after* processing the latter classes.jar.

Please double-check your project and ensure you're not including the same .jar file and/or the same Java types multiple times.
Comment 5 microcircuitssigloxxi 2015-10-30 03:06:42 UTC
This project compiles correctly before update to xamarin.android.Wear 1.3.0.0
It fails when I upgrade.
I disabled proguard but I can't compile.

Regards,
Comment 6 Jonathan Pryor 2015-10-30 17:22:34 UTC
> I disabled proguard but I can't compile.

That's odd.

That said, since proguard is getting multiple copies of the "same" .jar file, dx would as well (or *should*...), and thus *packaging* would hit a similar problem.
Comment 7 Jon Dick 2015-11-02 15:05:53 UTC
This should be fixed in 1.3.0.1, please update to that nuget package, delete your bin/ and obj/ folders, and rebuild.
Comment 8 microcircuitssigloxxi 2015-11-03 06:59:56 UTC
Jon,
I reinstall nuget package and still fails.

Regards,
Comment 9 Jon Dick 2015-11-03 07:05:33 UTC
Could you please upload a repro? I can't reproduce the failure here.
Comment 10 microcircuitssigloxxi 2015-11-04 02:40:07 UTC
Hi,
I made some test, and finally I can compile the Wear extension.
I remove ProGuard from Wear extension.
Why cannot use ProGuard?
Regards,
Comment 11 Jon Dick 2015-11-04 08:06:16 UTC
Not sure, I would need to see a reproducible sample solution with the issue to have any further suggestions/ideas.