question

TolgaKk-5564 avatar image
1 Vote"
TolgaKk-5564 asked AzrinSani-2669 commented

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

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.

vs-msbuild
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you resolve this?? I'mm stuck after adding Firebase

3 Votes 3 ·

1 Answer

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered

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.


image.png (30.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.