From 22da5a092d521dffe0ad0025a1928e601f09f5d6 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Fri, 20 Jan 2017 13:05:14 +0000 Subject: [PATCH] [Xamarin.Android.Build.Tasks] Unable to run Multi-Dex Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51356 Commit a967b24c added a PROGUARD_HOME environment variable when running Proguard and MultiDex. However it does break things on windows. The problem is down to a bug in the Google proguard.bat file where a " is in the wrong place. This results in the following error. Unable to access jarfile C:\Program Files (x86)\Android\android-sdk\tools\proguard"\lib\proguard.jar -injars 'C:\Program' Note the " in the wrong place. This does NOT occur if we allow the android tooling to find proguard itself rather than specifying a path (via the environment variable) This commit removes the variable from the Windows environment this seems to fix the issue. --- .../Tasks/CreateMultiDexMainDexClassList.cs | 3 ++- src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/CreateMultiDexMainDexClassList.cs b/src/Xamarin.Android.Build.Tasks/Tasks/CreateMultiDexMainDexClassList.cs index 1f85ef87150..06ea497a5c9 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/CreateMultiDexMainDexClassList.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/CreateMultiDexMainDexClassList.cs @@ -51,7 +51,8 @@ public override bool Execute () EnvironmentVariables = string.IsNullOrEmpty (MSBuildRuntimeType) || MSBuildRuntimeType == "Mono" ? new string [] { "PROGUARD_HOME=" + ProguardHome } : - new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8", "PROGUARD_HOME=" + ProguardHome }; + //TODO ReAdd the PROGUARD_HOME env variable once we are shipping our own proguard + new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8" }; return base.Execute (); } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs index 28539bfaf5c..e0f7942a7cb 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs @@ -111,7 +111,8 @@ public override bool Execute () EnvironmentVariables = string.IsNullOrEmpty (MSBuildRuntimeType) || MSBuildRuntimeType == "Mono" ? new string [] { "PROGUARD_HOME=" + ProguardHome } : - new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8", "PROGUARD_HOME=" + ProguardHome }; + //TODO ReAdd the PROGUARD_HOME env variable once we are shipping our own proguard + new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8" }; return base.Execute (); }