Bug 56219 - Multi-dex flag ignored\not passed down to the command line
Summary: Multi-dex flag ignored\not passed down to the command line
Status: RESOLVED DUPLICATE of bug 56192
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.3 (15.2)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2017-05-11 11:45 UTC by uwantfries
Modified: 2017-05-11 12:46 UTC (History)
1 user (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 uwantfries 2017-05-11 11:45:13 UTC
The multidex android setting is ignored\not passed down to the command line.

I was getting the too many Dex entries so I enabled the flag and clean/rebuilt same problem. Restarted VS. Same problem. The only way I could force it was to change the MSBuild Xamarin.Android.Common.targets and  C:\Android\MonoDroid\v7.1\Xamarin.Android.Common.targets file

I altered 
<AndroidEnableMultiDex Condition="'$(AndroidEnableMultiDex)'==''">False</AndroidEnableMultiDex>
<AndroidEnableMultiDex Condition="''==''">False</AndroidEnableMultiDex>

to force the multidex to trigger.


Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA807
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA807
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA807
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA807
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA807
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.0.20622.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

GorillaPlayerPackage Extension   1.0
GorillaPlayerPackage Visual Studio Extension Detailed Info

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

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

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

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

Xamarin.Android (448f54f)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (30b6e87)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 uwantfries 2017-05-11 11:54:08 UTC
this is what I was geeting before I edited the .targets file (with the muti-dex checkbox set)

2>Task "CreateMultiDexMainDexClassList" skipped, due to false condition; ('$(AndroidEnableMultiDex)' == 'True' And '$(AndroidCustomMainDexListFile)' == '') was evaluated as ('False' == 'True' And '' == '').
2>Task "Delete"
2>  File "obj\Debug\android\bin\classes\*.dex" doesn't exist. Skipping.
2>Done executing task "Delete".
2>Using "CompileToDalvik" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
2>Task "CompileToDalvik"
2>  CompileToDalvik
2>    JavaOptions: 
2>    JavaMaximumHeapSize: 1G
2>    ClassesOutputDirectory: obj\Debug\android\bin\classes
2>    JavaToolPath: C:\Android\Java\jdk1.8.0_131\\bin
2>    DxJarPath: C:\Android\android-sdk\build-tools\25.0.3\\lib\dx.jar
2>    ToolExe: java.exe
2>    ToolPath: 
2>    UseDx: False
2>    MultiDexEnabled: False
2>    MultiDexMainDexListFile: obj\Debug\multidex.keep
2>    JavaLibrariesToCompile:
2>      C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.1\mono.android.jar
2>      obj\Debug\__library_projects__\FloatingActionButton\library_project_imports\bin\classes.jar
2>      obj\Debug\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar
2>      obj\Debug\__library_projects__\PDFNetAndroid\library_project_imports\PDFNet.jar
2>      obj\Debug\__library_projects__\Tools\library_project_imports\bin\classes.jar
2>      obj\Debug\__library_projects__\Tools\library_project_imports\libs\commons-io-2.4.jar
2>      obj\Debug\__library_projects__\Tools\library_project_imports\libs\sc-light-jdk15on-
2>      obj\Debug\__library_projects__\Tools\library_project_imports\libs\scpkix-jdk15on-
2>      obj\Debug\__library_projects__\Tools\library_project_imports\libs\scprov-jdk15on-
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Animated.Vector.Drawable\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Compat\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Core.UI\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Core.Utils\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Design\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Fragment\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Media.Compat\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Transition\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v4\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v7.AppCompat\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v7.CardView\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v7.MediaRouter\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v7.Palette\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.v7.RecyclerView\library_project_imports\classes.jar
2>      obj\Debug\__library_projects__\Xamarin.Android.Support.Vector.Drawable\library_project_imports\classes.jar
2>  C:\Android\Java\jdk1.8.0_131\\bin\java.exe -Xmx1G -jar C:\Android\android-sdk\build-tools\25.0.3\\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\v7.1\mono.android.jar"
Comment 2 dean.ellis 2017-05-11 12:46:59 UTC
This is being caused by https://bugzilla.xamarin.com/show_bug.cgi?id=56192

*** This bug has been marked as a duplicate of bug 56192 ***