Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error after Enable Multi-Dex in Xamarin Android

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' property to true (Since the app hit the dex method limit of 65K). We are getting an error

..\CREATEMULTIDEXMAINDEXCLASSLIST: Error: Expecting class path
separator ';' before
'\Android\android-sdk\build-tools\21.1.1\lib\shrinkedAndroid.jar' in
argument number 8

I am using Xamarin Studio Version 5.9 (build 431) Xamarin.Android Version: 5.1.0

Please help to fix this Issue in Xamarin.

like image 863
user1242496 Avatar asked Jun 11 '15 09:06

user1242496


People also ask

How to enable MultiDex in Xamarin android?

MultiDex is a technique of splitting your application code into multiple . dex files – each containing at most 65 KB of bytecode. To enable MultiDexing in Xamarin. Android just go to your project settings and check “Enable Multi-Dex” (pic rel.)

What is multi Dex Android?

In Android, the compilers convert your source code into DEX files. This DEX file contains the compiled code used to run the app. But there is a limitation with the DEX file. The DEX file limits the total number of methods that can be referenced within a single DEX file to 64K i.e. 65,536 methods.


2 Answers

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.

like image 68
KMB Avatar answered Oct 15 '22 20:10

KMB


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"
like image 34
xleon Avatar answered Oct 15 '22 21:10

xleon