question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build fails with `Xamarin.Android.D8.targets(79,5): MSB6006 "java.exe" exited with code 1`

See original GitHub issue

Description

After update to preview11 app fails to build with: https://github.com/maxkoshevoi/NureTimetable/runs/4721371318?check_suite_focus=true#step:6:25

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.101-preview.11.117\tools\Xamarin.Android.D8.targets(79,5): error MSB6006: "java.exe" exited with code 1.

It has been building fine in preview 10.

Steps to Reproduce

  1. Build this app https://github.com/maxkoshevoi/NureTimetable/tree/0f02e8f8ac5a927e97fb5e0ceee2a0dde78764d2 using preview 11

Version with bug

Preview 11

Last version that worked well

Preview 10 (current)

Affected platforms

Android

Affected platform versions

All

Did you find any workaround?

Works, but not always:

<Target Name="Remove1B1B3F705C33DF84" AfterTargets="_CheckDuplicateJavaLibraries">
  <ItemGroup>
    <ExtractedJarImportsToRemove Include="@(ExtractedJarImports)" Condition="'%(Filename)' == '1B1B3F705C33DF84'" />
    <ExtractedJarImports Remove="@(ExtractedJarImportsToRemove)" />
  </ItemGroup>
</Target>

Relevant log output

Type com.google.common.util.concurrent.ListenableFuture is defined multiple times
Error in C:\Users\Mi\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.4\buildTransitive
et6.0-android31.0\..\..\jar\guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class:
Type com.google.common.util.concurrent.ListenableFuture is defined multiple times: C:\Users\Mi\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.4\buildTransitive
et6.0-android31.0\..\..\jar\guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class, obj\Debug
et6.0-android31\lp\133\jl\libs\009E21B983A37ED6.jar:com/google/common/util/concurrent/ListenableFuture.class
Compilation failed
MSB6006: "java.exe" exited with code 1.
Done executing task "D8" -- FAILED.
Done building target "_CompileToDalvik" in project "NureTimetable.csproj" -- FAILED.
Done building project "NureTimetable.csproj" -- FAILED.
Build FAILED.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hazwan223commented, Feb 21, 2022

I also get the similar issue in VS 2022 community but I can fix it by changing dex compiler from d8 (default) to dx then build the project and i change dex compiler back to d8 as the default setting.

how do I do this exactly? thank you.

You can try it from your android project properties > android options > dex compiler

Are you on MAUI?

1reaction
sharpwoodcommented, Jan 6, 2022

Installing syncfusion or Maui community toolkit in the newly created Maui program will both cause this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin android project "java.exe" exited with code 1
Android. D8. targets(51,5)) of the 'java.exe exited with code 1' error type is mostly associated with either proguard or incompability however ...
Read more >
Xamarin.Android error MSB6006: "java.exe" exited with ...
I can conclude that the issue is related to proguard (also for the Debug build, even if you are not selected the code...
Read more >
error MSB6006: "java.exe" exited with code 1.
I am trying to develop app with Xamarin.Android in Visual Studio ... Android.D8.targets(51,5): error MSB6006: "java.exe" exited with code 1.
Read more >
"java.exe" exited with code 1 - Xamarin
I have the following error with Visual Studio 2019 - Xamarin. ... Android.D8.targets(79,5): error MSB6006: "java.exe" salió con el código 1.
Read more >
Xamarin/Android fails to compile in VS 2019
I am using Visual Studio 2019 and Xamarin Forms v4.8. ... Android.D8.targets(79,5): error MSB6006: "java.exe" exited with code 1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found