Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

MultiDex support Android (Xamarin Studio)

Hi all,

I'm currently working on a project where I have to enable multidex support because of the dalvik method reference constraints. This is mainly because I'm including very big libraries such as OpenCV and various google play service libraries.

However, I'm running in to problems when I'm building this with the multidex flag enabled. It seems that the toolchain on Xamarin Studio does not really like libraries which contains spaces in the file path. It fails on the following step as the jar from the openCV library contains spaces:

Target _CompileToDalvikWithDx: Created directory "obj/Release/proguard" Tool /Users/michaelgobbers/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.0//mainDexClasses execution started with arguments: --output obj/Release/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/Release/__library_projects__/OpenCV/library_project_imports/bin/opencv library - 3.1.0.jar':'obj/Release/android/bin/classes' Error: Expecting class path separator ':' before 'library' in argument number 3 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Tool exited with code: 10. Output: Error: Expecting class path separator ':' before 'library' in argument number 3

If I do the exact same thing on visual studio it does seem to work...

This is easily reproducible if you clone the following repo and try to build the demo project with multidex support enabled.
https://github.com/TrekDev/Xamarin.Android.OpenCV

Anyone running in to the same issues and how would I overcome this issue?

Best Answer

Answers

Sign In or Register to comment.