error MSB6006: "java.exe" exited with code 1.

Tolga Küçük 6 Reputation points
2021-03-26T08:20:02.777+00:00

Hi everyone.
I am trying to develop app with Xamarin.Android in Visual Studio.
I am getting error which is : 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\Xamarin.Android.D8.targets(51,5): error MSB6006: "java.exe" exited with code 1.

I am getting this error after I add Xamarin.Firebase.Auth package.

Here is my all packages in my .csproj:
<ItemGroup>
<PackageReference Include="Xamarin.Android.Support.Design">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.5" />
<PackageReference Include="Xamarin.Build.Download">
<Version>0.4.11</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Auth">
<Version>60.1142.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Database">
<Version>60.1142.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2012</Version>
</PackageReference>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Google.Guava" ExcludeAssets="all">
<Version>27.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Basement">
<Version>117.6.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Tasks">
<Version>117.2.1</Version>
</PackageReference>
</ItemGroup>

And this the page where I double clicked the error:
<R8
Condition=" '$(_UseR8)' == 'True' "
ToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
JarPath="$(AndroidR8JarPath)"
AndroidManifestFile="$(IntermediateOutputPath)android\AndroidManifest.xml"
OutputDirectory="$(_AndroidIntermediateDexOutputDirectory)"
Debug="$(AndroidIncludeDebugSymbols)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
EnableDesugar="$(AndroidEnableDesugar)"
AndroidSdkBuildToolsPath="$(AndroidSdkBuildToolsPath)"
AcwMapFile="$(_AcwMapFile)"
ProguardCommonXamarinConfiguration="$(IntermediateOutputPath)proguard\proguard_xamarin.cfg"
ProguardGeneratedReferenceConfiguration="$(_ProguardProjectConfiguration)"
ProguardGeneratedApplicationConfiguration="$(IntermediateOutputPath)proguard\proguard_project_primary.cfg"
ProguardMappingFileOutput="$(AndroidProguardMappingFile)"
ProguardConfigurationFiles="@(_ProguardConfiguration)"
EnableShrinking="$(_R8EnableShrinking)"
EnableMultiDex="$(AndroidEnableMultiDex)"
MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
CustomMainDexListFiles="@(MultiDexMainDexList)"
IgnoreWarnings="$(AndroidR8IgnoreWarnings)"
ExtraArguments="$(AndroidR8ExtraArguments)"
/>

I have been researching solutions about this topic since 2 days but I couldnt find it.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,276 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,406 Reputation points
    2021-03-29T08:08:51.17+00:00

    Hi TolgaKk,

    You can try to change the TargetFramework to Android 11, then rebuild you project. If the error persists, could you provide the build log after setting build output to Detailed.
    82313-image.png

    Best Regards,
    Dylan


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our **documentation to enable e-mail notifications if you want to receive the related email notification for this thread.**

    0 comments No comments