This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 51356 - Unable to run Multi-Dex
Summary: Unable to run Multi-Dex
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 7.1 (C9)
Hardware: PC Windows
: High major
Target Milestone: 7.1 (C9)
Assignee: dean.ellis
URL:
: 51143 51494 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-11 02:06 UTC by James Montemagno [MSFT]
Modified: 2017-02-15 11:58 UTC (History)
7 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description James Montemagno [MSFT] 2017-01-11 02:06:47 UTC
When I enable Multi-dex I get:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Unable to access jarfile C:\Program Files (x86)\Android\android-sdk\tools\proguard"\lib\proguard.jar -injars 'C:\Program	MonkeysApp	C:\GitHub\MonkeysApp-AppIndexing\MonkeysApp\CREATEMULTIDEXMAINDEXCLASSLIST


It looks like there is an extra " for the proguard path  as it does exist.

Here is my app that needs it: https://github.com/jamesmontemagno/app-monkeys/tree/full-ads-sdk
Comment 1 dean.ellis 2017-01-12 10:35:28 UTC
Which version of VS are you using for this?
Do you get the same issues from the command line MSBuild? If so which version has the problem?
Comment 2 James Montemagno [MSFT] 2017-01-12 19:52:06 UTC
My info: https://gist.github.com/jamesmontemagno/0eb2d6d196daf2d0e39aa571025aa349


I did see this post: https://forums.xamarin.com/discussion/comment/245334/#Comment_245334

Could be an issue in the Android SDK... I guess, seems odd though. 

I didn't run via command line at all. I would assume this may also repo on mac?

So, I did the fix from the forum and it seemed to work, but it was a pain because of persmission issues and trying to modify it.
Comment 3 James Montemagno [MSFT] 2017-01-12 19:52:58 UTC
Although, now I actually get:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Expecting class path separator ';' before '\Android\android-sdk\build-tools\25.0.2\lib\shrinkedAndroid.jar' in argument number 8	MonkeysApp	C:\GitHub\MonkeysApp-AppIndexing\MonkeysApp\CREATEMULTIDEXMAINDEXCLASSLIST
Comment 4 dean.ellis 2017-01-17 16:26:28 UTC
*** Bug 51143 has been marked as a duplicate of this bug. ***
Comment 5 dean.ellis 2017-01-18 10:01:02 UTC
*** Bug 51494 has been marked as a duplicate of this bug. ***
Comment 6 dean.ellis 2017-01-18 11:37:29 UTC
James

I can't repo this on the latest Alpha channel. XA 7.0.2.37.

The proguard path does not have the problematic " at the end of it. 
Are you able to test it again on Alpha and see if you still get the problem?
Comment 7 Peter Collins 2017-01-18 23:39:13 UTC
@Dean XA 7.0.2.37 is a previous stable release (C8SR1). The C9 Alpha/Beta available on Windows is is XVS 4.3.0.598 (cycle9/95cf4d3 w/ XA 7.1.0.19 (cycle9/ed959b6)).

This also only reproduces on Windows, and is a new failure which only manifests in Cycle9. I am able to reproduce from Windows command line with msbuild as well as from within VS 2015 using the following:

https://bosstoragemirror.blob.core.windows.net/wrench/xvs-win-cycle9/95/95cf4d3de5a9c8672a294ffc2b5a32cb6581fdb0/Xamarin.VisualStudio_4.3.0.598.msi

I can reproduce with a new template (which doesn't _need_ multidex, but still fails in the same way) and the project James linked in the description.
Comment 8 dean.ellis 2017-01-19 16:05:04 UTC
I have managed to repo this. 
Its weird, the proguard.bat in android tooling has this follow


java -jar "%PROGUARD_HOME%"\lib\proguard.jar %*

note the "" around %PROGUARD_HOME% they look in the wrong place. As a result its producing the error we are seeing.
Comment 9 dean.ellis 2017-01-19 16:07:20 UTC
In this case we are not calling proguard directly. It is being called from mainDexClasses.bat
Comment 12 Peter Collins 2017-01-19 19:25:35 UTC
It's definitely odd as this issue does seem to have been around for a _while_, but it only now manifests after updating to Cycle9 from what I've seen. If you use the current XVS stable the same issue is not reproducible on the same environment. That indicates to me that something also changed on our end between the two releases?
Comment 13 dean.ellis 2017-01-20 10:20:01 UTC
The only change I can see was in October last year 

https://github.com/xamarin/xamarin-android/commit/a967b24cf3ecc8cecc7dca41bef841c716a33791

I will try and see if that caused the issue
Comment 14 dean.ellis 2017-01-20 13:16:05 UTC
This PR might do the trick 

https://github.com/xamarin/xamarin-android/pull/392
Comment 15 dean.ellis 2017-01-27 09:53:08 UTC
Fixed in xamarin-android/master/d71dcc99
Comment 16 Michael 2017-01-27 11:10:26 UTC
Hi,

When is this going to be in a stable release?

Regards

MIchael
Comment 17 Danish Akhtar 2017-01-31 13:32:10 UTC
I am also able to reproduce this issue with XVS 4.3.0.550. Also, tried to verify this issue with latest master XVS 99.1.0.564 but observed that the XA mentioned in Comment 15 is not merge with this XVS 99.1.0.564, it includes XA 7.199.59(41db8f9).

Could you please merge this xamarin-android/master/d71dcc99 with latest master XVS? So, that I can verify this issue with master.

Thanks!
Comment 18 Jatin 2017-02-01 19:26:52 UTC
I have checked this issue with latest build of master XVS i.e.
XVS 991.0.573 cec65c98d6809bda996bb09ffedaa70e462f9898 and observed that this issue still exist with this build.

Could you please let me know with which version of XVS contains the fixed XA build ?

As of now I am reopening this issue.

thanks
Comment 19 dean.ellis 2017-02-06 10:31:55 UTC
@Jatin

Can you provide diagnostic output of the problem please. The version of VS you used should contain the fix. I need more information as to what is going on.
Comment 20 Michael 2017-02-06 11:33:41 UTC
I'm not quire sure what you want. I have given the error message. See below for the output of my Visual Studio setup

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Enterprise

Architecture and Modeling Tools   00322-90001-26663-AA288
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Microsoft Visual Studio Tools for Applications 2015   00322-90001-26663-AA288
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-90001-26663-AA288
Microsoft Visual Basic 2015

Visual C# 2015   00322-90001-26663-AA288
Microsoft Visual C# 2015

Visual C++ 2015   00322-90001-26663-AA288
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Analysis Services   13.0.1701.8
Microsoft SQL Server Analysis Services Designer 
Version 13.0.1701.8

SQL Server Data Tools   14.0.61021.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services   13.0.1701.8
Microsoft SQL Server Reporting Services Designers 
Version 13.0.1701.8

StyleCop   4.7.54.0
Provides source code style and consistency tools. See http://stylecop.codeplex.com/ for more details.

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.2.2.6 (27a9b40)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.2.42 (501e63c)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.3.1.7 (8b53676)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 21 Jatin 2017-02-06 16:33:54 UTC
@Dean,

I have checked this issue with latest XVS master build Xamarin.VisualStudio_99.1.0.590_950fc7997dc95b4f38c4a40413eccc2f5bc4d283
containing Xamarin.Android 7.1.99.62 (b5ae7fe) and still getting this issue

>>mainDexClasses.bat --output obj\Debug\multidex.keep "'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.1\mono.android.jar';'C:\Program Files (x86)\MSBuild\Xamarin\Android\android-support-multidex.jar';'obj\Debug\android\bin\classes'"  (TaskId:189)
1>CREATEMULTIDEXMAINDEXCLASSLIST : error : Unable to access jarfile D:\abhi\android-sdk\tools\proguard"\lib\proguard.jar -injars 'C:\Program


Supplement Info:
Build Output: https://gist.github.com/jatin360/59d39f0eadc431be90c43431b2cee0fc
Envt Info:
https://gist.github.com/jatin360/150512425ff10fcf9178416ea89bb55d

hence, I am reopening this issue.
Comment 22 dean.ellis 2017-02-07 09:48:35 UTC
Pr is up https://github.com/xamarin/xamarin-android/pull/420
Comment 23 Jonathan Pryor 2017-02-08 17:22:29 UTC
PR #420 is merged; fixed in:

https://github.com/xamarin/xamarin-android/commit/1c53d6a4e37e82c94a46adfbed89c3d64dfe2cf8
monodroid/master/cda45e28
Comment 24 Peter Collins 2017-02-10 16:33:19 UTC
Marking as resolved per Comment #23.

Multidex invocation on Windows is again working for me using build tools 23.x and JDK 1.7 with Xamarin 99.1.0.613(ac4a0ec) & Xamarin.Android 7.1.99.72(cda45e2).

Will wait to mark as verified once this is applied to cycle9.
Comment 25 Jonathan Pryor 2017-02-10 17:00:04 UTC
Fixed for C9 in:

https://github.com/xamarin/xamarin-android/commit/e537a2dd
monodroid/cycle9/0ff0aec0
Comment 26 Jatin 2017-02-10 19:15:20 UTC
@Peter,

I have checked this with latest master XVS build
Xamarin.VisualStudio_99.1.0.613_ac4a0eca3ac4b103659d02a13702b26a3f59f140
containing Xamarin.Android 7.1.99.72(cda45e2) and JDK 1.8.0_102 and still getting the issue.

Supplement Info:
Screencast: https://www.screencast.com/t/yNUwKIc1
Envt Info: https://gist.github.com/sachins360/707f8425101d10df1398432543549b6a
Build Output: https://gist.github.com/sachins360/da67448729e14ddd2b1afa3bfb4736b5

Hence, I am reopening this issue.
Comment 27 Peter Collins 2017-02-10 21:48:59 UTC
@Jatin the error you are hitting in Comment #26 is not the same as originally reported, and is due to the fact that the proguard tool provided by the Android SDK requires JDK 1.7 or lower.

Note You need to log in before you can comment on or make changes to this bug.