Bug 42235 - Building av Multidex supported Android project fails. Cannot find jar.
Summary: Building av Multidex supported Android project fails. Cannot find jar.
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 6.0.1 (C6SR1)
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2016-06-29 10:14 UTC by Christer V. Aas
Modified: 2016-07-12 22:27 UTC (History)
3 users (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 Christer V. Aas 2016-06-29 10:14:53 UTC
I am bringing in SpongyCastle library with bindings and need to build with Multidex support.

But I get the following error when compiling the Android project.

Target _CheckDuplicateJavaLibraries:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Error executing task CheckDuplicateJavaLibraries: Could not find file "/Users/christervaas/Library/Developer/Xamarin/android-sdk-macosx/extras/android/support/multidex/library/libs/android-support-multidex.jar".

Is this a bug? It seems like the file path is a bit off. That location does not exist on my machine.
Comment 1 Atsushi Eno 2016-06-29 15:02:41 UTC
If you have custom Android SDK setup, please make sure that you have installed multidex support library which is *obsoleted* component.
Comment 2 Christer V. Aas 2016-06-29 21:57:15 UTC
So is there an official way to get multidex support without that *obsoleted* library? I'll try to find it through the SDKs and see how that works. How will this be supported in Xamarin when that library is gone from the offical SDK?
Comment 3 Atsushi Eno 2016-06-30 17:09:25 UTC
The official way is this: our standard setup includes that "techinically obsoleted" package and users should have no problem.

It is very easy to install that obsoleted package within custom Android SDK setup.

We will switch to m2repository at some stage. It is just not in high priority.
Comment 4 Ben Rooney 2016-07-12 22:08:13 UTC
Hi Atsushi,

What do you mean by a custom Android SDK setup? I'm having this same issue but I don't think I have anything custom. My Android SDK is installed in ~/Library/Android/sdk which I think is pretty standard

You say it is very easy to install the obsolete package. Do you have some directions on how to do this?

Comment 5 Ben Rooney 2016-07-12 22:27:08 UTC
Hi Atusushi,

Just wanted to follow up on my previous comment.

I noticed that my Xamarin preference was set up to use ~/Library/Developer/Xamarin/android-sdk-macosx for the SDK but that location doesn't have an extras sub folder. I updated the preferences to point to ~/Library/Android/sdk which has the required multidex jar file in the extras folder. 

At this point I was able to build the project

However based on your comments above, the xamarin android sdk should already have it installed as well

I'm a bit confused here