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 had the same problem. To resolve it you must go to the properties of your project and in the option Android Options
in packaging you disable Multi-Dex
. And in the debugger option choose Xamarin
or not Microsoft
.
I think that it resolves your problem.
For future reference, there is also a bug if you have JDK 1.8 installed..
See this thread https://bugzilla.xamarin.com/show_bug.cgi?id=44013
Unfortunately the actual bug is inaccessible to general public.. https://bugzilla.xamarin.com/show_bug.cgi?id=42669
We had the same problem on our build server, and we've had to move the Android SDK to a path with no spaces e.g. C:\android-sdk\...
Obviously we needed to update the ANDROID_HOME
environment variable to the new path, and set the SDK paths in Xamarin Studio and Visual Studio.
This has solved the problem for us.
For those who don´t want to change the Android SDK actual location plus ANDROID_HOME env variable, a simple link is enough:
mklink /D "C:\android-sdk" "C:\Program Files (x86)\Android\android-sdk"
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
Please Put your SDK into where is available Enough space and then put your jar or dll file there it will worked.