Bug 51720 - Unable to build Android app with Multidex enabled if build configuration contains a space
Summary: Unable to build Android app with Multidex enabled if build configuration cont...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.1 (C9)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 15.3
Assignee: dean.ellis
Depends on: 33052
  Show dependency tree
Reported: 2017-01-23 22:45 UTC by Nate Cook
Modified: 2017-07-14 07:31 UTC (History)
3 users (show)

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

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:

Description Nate Cook 2017-01-23 22:45:01 UTC
# Steps to reproduce
Start with an existing Android app that is large enough to need multi-dex
Create an additional debug build configuration for the Android app. The name of the build config should contain a space, for example "Debug UITest"
Enable multi-dex for the Android app, for that build configuration

# Expected behavior
App builds without error

# Actual behavior
Build fails with the following error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Tool exited with code: 10. Output: /Users/ncook/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.2//mainDexClasses: line 148: $2: ambiguous redirect
Error: Expecting class path separator ':' before 'UITest/__library_projects__/UrlImageViewHelper/library_project_imports/urlimageviewhelper-1.0.4.jar' in argument number 3

Renaming the build config so that it no longer contains a space in the build config name resolves the issue.

# Supplemental info (logs, images, videos)
Created directory "obj/Debug UITest/proguard"
Tool /Users/ncook/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.2//mainDexClasses execution started with arguments: --output "obj/Debug UITest/multidex.keep" '/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v5.0/mono.android.jar':'/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/android-support-multidex.jar':'obj/Debug UITest/__library_projects__/UrlImageViewHelper/library_project_imports/urlimageviewhelper-1.0.4.jar':'obj/Debug UITest/__library_projects__/mp4parser/library_project_imports/__reference__aspectjrt-1.7.3.jar' 
/Users/ncook/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.2//mainDexClasses: line 148: $2: ambiguous redirect
Error: Expecting class path separator ':' before 'UITest/__library_projects__/UrlImageViewHelper/library_project_imports/urlimageviewhelper-1.0.4.jar' in argument number 3

# Test environment (full version information)
=== Xamarin Studio Community ===

Version 6.2 (build 1757)
Installation UUID: 2a603873-20f2-4e5d-a22b-d1b5790caa3b
	Mono 4.8.0 (mono-4.8.0-branch/cd26828) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000459

=== NuGet ===


=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.iOS ===

Version: (Xamarin Studio Community)
Hash: 9975cb1
Branch: cycle9
Build date: 2017-01-13 10:35:52-0500

=== Xamarin.Android ===

Version: (Xamarin Studio Community)
Android SDK: /Users/ncook/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: (Xamarin Studio Community)

=== Xamarin Inspector ===

Hash: 1f3067d
Branch: master
Build date: Tue, 15 Nov 2016 21:13:59 GMT

=== Build Information ===

Release ID: 602001757
Git revision: d769a24532f7b7a9933fc9187631b4175fb94be6
Build date: 2017-01-17 15:00:00-05
Xamarin addins: 3fda1860d20ac17fb238c320a021b07d96dc9e53
Build lane: monodevelop-lion-cycle9

=== Operating System ===

Mac OS X 10.11.6
Darwin Nates-MacBook-Pro.local 15.6.0 Darwin Kernel Version 15.6.0
    Mon Jan  9 23:07:29 PST 2017
    root:xnu-3248. x86_64

=== Enabled user installed addins ===

Addin Maker 1.3.2
Comment 1 Jonathan Pryor 2017-01-26 15:39:50 UTC
@Dean? Looks like we need to review path quoting...
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-29 23:09:08 UTC Comment hidden (obsolete)
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-29 23:21:18 UTC
Reopening because I accidentally marked this as a duplicate.  I only intended to mark this as "Depends On".  The underlying cause might in the end be the same as Bug 33052, but the mechanism to replicate the problem is slightly different in this bug (spaces in the build configuration rather than spaces in the Android SDK path).
Comment 4 dean.ellis 2017-05-03 13:50:07 UTC
Fixed in Xamarin-android/master/6829b7d1