Skip to content

Commit 6601fbc

Browse files
committed
[java-runtime] Use r8.jar instead of dx
`dx` doesn't like OpenJDK 11 on Windows: "C:\Users\dlab14\android-toolchain\sdk\build-tools\29.0.2\dx" --dex --no-strict --output="C:\A\vs2019xam00000H-1\_work\2\s\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\java_runtime.dex" "C:\A\vs2019xam00000H-1\_work\2\s\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\java_runtime.jar" ##[debug]Processed: ##vso[task.logdetail id=dffb25d4-cb0b-4e58-94d2-4b9a4f215bed;parentid=;name=EXEC;type=Build;starttime=2020-04-19T01:21:10.0332656Z;state=InProgress;] ##[error]EXEC(0,0): Error : No suitable Java found. In order to properly use the Android Developer ##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=EXEC;linenumber=0;columnnumber=0;code=;]No suitable Java found. In order to properly use the Android Developer ##[debug]Processed: ##vso[task.logdetail id=dffb25d4-cb0b-4e58-94d2-4b9a4f215bed;parentid=;type=Build;result=Failed;finishtime=2020-04-19T01:21:10.0488457Z;progress=100;state=Completed;parentid=;name=;] EXEC : error : No suitable Java found. In order to properly use the Android Developer [C:\A\vs2019xam00000H-1\_work\2\s\src\java-runtime\java-runtime.csproj] Tools, you need a suitable version of Java JDK installed on your system. We recommend that you install the JDK version of JavaSE, available here: http://www.oracle.com/technetwork/java/javase/downloads If you already have Java installed, you can define the JAVA_HOME environment variable in Control Panel / System / Avanced System Settings to point to the JDK folder. You can find the complete Android SDK requirements here: http://developer.android.com/sdk/requirements.html ##[error]src\java-runtime\java-runtime.targets(59,3): Error MSB3073: The command ""C:\Users\dlab14\android-toolchain\sdk\build-tools\29.0.2\dx" --dex --no-strict --output="C:\A\vs2019xam00000H-1\_work\2\s\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\java_runtime.dex" "C:\A\vs2019xam00000H-1\_work\2\s\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\java_runtime.jar"" exited with code -1. Use `r8.jar` instead, to hopefully avoid the problem.
1 parent e6d7542 commit 6601fbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/java-runtime/java-runtime.targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@
5757
Inputs="@(_RuntimeOutput->'%(Identity)')"
5858
Outputs="@(_RuntimeOutput->'%(OutputDex)')">
5959
<Exec
60-
Command="&quot;$(AndroidSdkDirectory)\build-tools\$(XABuildToolsFolder)\dx&quot; --dex --no-strict --output=&quot;%(_RuntimeOutput.OutputDex)&quot; &quot;%(_RuntimeOutput.OutputJar)&quot;"
60+
Command="&quot;$(JavaPath)&quot; -classpath &quot;$(OutputPath)\r8.jar&quot; com.android.tools.r8.D8 --release --no-desugaring --output &quot;%(_RuntimeOutput.IntermediateRuntimeOutputPath)&quot; &quot;%(_RuntimeOutput.OutputJar)&quot;"
6161
EnvironmentVariables="JAVA_HOME=$(JavaSdkDirectory)"
6262
/>
63+
<Move
64+
SourceFiles="@(_RuntimeOutput->'%(IntermediateRuntimeOutputPath)\classes.dex')"
65+
DestinationFiles="%(_RuntimeOutput.OutputDex)"
66+
/>
6367
</Target>
6468
</Project>

0 commit comments

Comments
 (0)