While creating a Xamarin Android application, after adding the reference to Infragistics Chart control and the Google Play services, we had to enable the \'Enable Multi-Dex\' pr
I'm facing this problem any time I make an update that change or install a new build-tools folder. So I decided to store the solution here for myself and for whom could benefit from this solution.
Some of the bugzilla link in other solutions or comments are not accessible from anyone. The reason for this is an issue with the Android SDK on Windows machines. The following fix needs to be applied to the build server and developer machines:
if DEFINED output goto redirect
call "%java_exe%" -Djava.ext.dirs="%frameworkdir%" com.android.multidex.MainDexListBuilder "%disableKeepAnnotated%" "%tmpJar%" "%params%"
goto afterClassReferenceListBuilder
:redirect
call "%java_exe%" -Djava.ext.dirs="%frameworkdir%" com.android.multidex.MainDexListBuilder "%disableKeepAnnotated%" "%tmpJar%" "%params%" 1>"%output%"
:afterClassReferenceListBuilder
And replace with:
SET params=%params:'=%
if DEFINED output goto redirect
call "%java_exe%" -Djava.ext.dirs="%frameworkdir%" com.android.multidex.MainDexListBuilder %disableKeepAnnotated% "%tmpJar%" %params%
goto afterClassReferenceListBuilder
:redirect
call "%java_exe%" -Djava.ext.dirs="%frameworkdir%" com.android.multidex.MainDexListBuilder %disableKeepAnnotated% "%tmpJar%" %params% 1>"%output%"
:afterClassReferenceListBuilder