Skip to content

Commit d71dcc9

Browse files
dellis1972jonpryor
authored andcommitted
[Xamarin.Android.Build.Tasks] Running Multi-Dex on Windows (#392)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=51356 Commit a967b24 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.
1 parent 50c4251 commit d71dcc9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/CreateMultiDexMainDexClassList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public override bool Execute ()
5151
EnvironmentVariables =
5252
string.IsNullOrEmpty (MSBuildRuntimeType) || MSBuildRuntimeType == "Mono" ?
5353
new string [] { "PROGUARD_HOME=" + ProguardHome } :
54-
new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8", "PROGUARD_HOME=" + ProguardHome };
54+
//TODO ReAdd the PROGUARD_HOME env variable once we are shipping our own proguard
55+
new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8" };
5556

5657
return base.Execute ();
5758
}

src/Xamarin.Android.Build.Tasks/Tasks/Proguard.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public override bool Execute ()
111111
EnvironmentVariables =
112112
string.IsNullOrEmpty (MSBuildRuntimeType) || MSBuildRuntimeType == "Mono" ?
113113
new string [] { "PROGUARD_HOME=" + ProguardHome } :
114-
new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8", "PROGUARD_HOME=" + ProguardHome };
114+
//TODO ReAdd the PROGUARD_HOME env variable once we are shipping our own proguard
115+
new string [] { "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8" };
115116

116117
return base.Execute ();
117118
}

0 commit comments

Comments
 (0)