Bug 57027 - Follow-up to Bug 33052: "Invalid option" causes java.exe failure during build with multidex if username contains spaces
Summary: Follow-up to Bug 33052: "Invalid option" causes java.exe failure during build...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: 15.3
Assignee: dean.ellis
URL:
Depends on:
Blocks: 33052
  Show dependency tree
 
Reported: 2017-05-31 23:42 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2017-06-22 19:56 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: Xamarin.Android 7.3.1.2 (9dbc4c5)


Attachments
Test case (25.02 KB, application/zip)
2017-05-31 23:42 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Diagnostic MSBuild output (55.94 KB, application/zip)
2017-05-31 23:47 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Attached are the logs generated during defect verification (3.92 KB, application/x-zip-compressed)
2017-06-05 07:29 UTC, Saurabh Paunikar
Details
[Verification] GOOD diagnostic MSBuild output (58.62 KB, application/zip)
2017-06-22 19:55 UTC, Brendan Zagaeski (Xamarin Team, assistant)
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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2017-05-31 23:42:10 UTC
Created attachment 22601 [details]
Test case

Follow-up to Bug 33052: "Invalid option" causes java.exe failure during build with multidex if username contains spaces




## Regression status: regression in current master development builds compared to XamarinVS 4.5.0.476 (1be4f0c), Xamarin.Android 7.3.1.2 (9dbc4c5)

BAD:  XamarinVS master    (c02a82f), Xamarin.Android master  (8a4a002)
GOOD: XamarinVS 4.5.0.476 (1be4f0c), Xamarin.Android 7.3.1.2 (9dbc4c5)




## Steps followed to test

Attempt to build the "MinimalMultidexTest" project from the attached test case in the Release configuration.  (The test project is just a new blank template app with the multidex setting enabled.)

msbuild /t:Build /p:Configuration=Release MinimalMultidexTest/MinimalMultidexTest.csproj




## BAD Results with XamarinVS master/c02a82f, Xamarin.Android master/8a4a002

The build fails.  The failure is due to a space in the path to the *.cvs.jar intermediate output file.  That path contains a space because my username "Windows User" contains a space.  (The build succeeds if I use a different username without a space.)



### Excerpt from the diagnostic MSBuild output

>   C:\Program Files\Java\jdk1.8.0_131\\bin\java.exe -Djava.ext.dirs=C:\android-sdk\build-tools\23.0.3\lib com.android.multidex.MainDexListBuilder C:\Users\Windows User\AppData\Local\Temp\k3oehsx4.cvs.jar "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.1\mono.android.jar;C:\Program Files (x86)\MSBuild\Xamarin\Android\android-support-multidex.jar;obj\Release\android\bin\classes"  (TaskId:185)
>   Invalid option C:\Users\Windows (TaskId:185)
>   Usage: (TaskId:185)
>    (TaskId:185)
>   Short version: Don't use this. (TaskId:185)
>    (TaskId:185)
>   Slightly longer version: This tool is used by mainDexClasses script to build (TaskId:185)
>   the main dex list. (TaskId:185)
> C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1957,3): error MSB6006: "java.exe" exited with code 1. [C:\source\MinimalProguardTest\MinimalMultidexTest\MinimalMultidexTest.csproj]
> Done executing task "CreateMultiDexMainDexClassList" -- FAILED. (TaskId:185)



## GOOD Results with XamarinVS 4.5.0.476 (1be4f0c), Xamarin.Android 7.3.1.2 (9dbc4c5)

The build completes without error.  (Note that I was testing _without_ a space in my Android SDK path for this particular test.)




## Additional testing environment info (brief)

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3

Microsoft .NET Framework
Version 4.7.02046

Java JDK 8u131 (1.8.0_131) 64-bit

Android SDK Tools 25.2.5
Android SDK Platform-tools 25.0.3
Android SDK Build-tools 23.0.3

Android 7.1.1 (API 25) SDK Platform rev. 3

Windows 10 version 1703 (OS Build 15063.296)
US English locale, US Eastern time zone
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-05-31 23:47:14 UTC
Created attachment 22602 [details]
Diagnostic MSBuild output
Comment 2 dean.ellis 2017-06-01 10:43:33 UTC
PR is up https://github.com/xamarin/xamarin-android/pull/618
Comment 3 dean.ellis 2017-06-01 18:26:58 UTC
Fixed in xamarin-android/master/d7951de5
Comment 4 Saurabh Paunikar 2017-06-05 07:29:36 UTC Comment hidden (obsolete)
Comment 5 Saurabh Paunikar 2017-06-05 07:30:11 UTC Comment hidden (obsolete)
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-05 18:02:15 UTC
I am setting the status of this bug back to resolved because the verification from Comment 4 and Comment 5 is invalid.  The path to the user home directory in Comment 4 and Comment 5 does not contain spaces.  It probably makes the most sense to run this verification on Windows with a username that contains spaces to match the testing environment info provided in Comment 0.
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-22 19:55:33 UTC
Created attachment 23062 [details]
[Verification] GOOD diagnostic MSBuild output

## Verification status: verified fixed on the 15.3 target release milestone

> GOOD: XamarinVS 4.6.0.240 (60c3d0e), Xamarin.Android 7.4.0.2 (5a73b38) (current "15.3 release" Beta version)
> BAD:  XamarinVS master    (94a6b85), Xamarin.Android master  (8a4a002) (old development build from before the fix)



## Excerpt from the GOOD diagnostic build output

>  C:\Program Files\Java\jdk1.8.0_131\\bin\java.exe -Djava.ext.dirs="C:\Program Files (x86)\Android\android-sdk\build-tools\26.0.0\lib" com.android.multidex.MainDexListBuilder "C:\Users\Windows User\AppData\Local\Temp\cbdacz44.rvo.jar" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.1\mono.android.jar;C:\Program Files (x86)\MSBuild\Xamarin\Android\android-support-multidex.jar;obj\Release\android\bin\classes"  (TaskId:186)
>   android/support/multidex/ZipUtil$CentralDirectory.class (TaskId:186)
>   android/support/multidex/MultiDexApplication.class (TaskId:186)
>   android/support/multidex/MultiDex$V19.class (TaskId:186)
>   android/support/multidex/MultiDex$V4.class (TaskId:186)
>   android/support/multidex/ZipUtil.class (TaskId:186)
>   android/support/multidex/MultiDexExtractor$1.class (TaskId:186)
>   android/support/multidex/MultiDexExtractor.class (TaskId:186)
>   android/support/multidex/MultiDex$V14.class (TaskId:186)
>   android/support/multidex/MultiDex.class (TaskId:186)
> Done executing task "CreateMultiDexMainDexClassList". (TaskId:186)



## Additional testing environment info (brief)

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3

Microsoft .NET Framework
Version 4.6.01586

Java JDK 8u131 (1.8.0_131) 64-bit

Android SDK Tools          25.2.5
Android SDK Platform-tools 26
Android SDK Build-tools    26

Android 7.1.1 (API 25) SDK Platform rev. 3

Windows 10 version 1607 (OS Build 14393.0)
US English locale, US Eastern time zone