Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in xamarin.kotlin.stdlib ($ReflectSdkVersion is defined multiple times) after migration from Xamarin.Forms #14954

Closed
ppiekarski2 opened this issue May 6, 2023 · 7 comments
Labels
area-core-platform Integration with platforms platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@ppiekarski2
Copy link

ppiekarski2 commented May 6, 2023

Description

Hey,

For last few days i;m fighting with migrating my app from Xamarin.Forms to MAUI.
I solved dozens of errors already but this one - i cannot wrap my head around.

Error:

MSBUILD : java.exe error JAVA0000: Error in \.nuget\packages\xamarin.kotlin.stdlib\1.8.10\buildTransitive\net6.0-android31.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-1.8.10.jar:kotlin/internal/jdk7/JDK7PlatformImplementations$ReflectSdkVersion.class:
MSBUILD : java.exe error JAVA0000: Type kotlin.internal.jdk7.JDK7PlatformImplementations$ReflectSdkVersion is defined multiple times: \.nuget\packages\xamarin.kotlin.stdlib\1.8.10\buildTransitive\net6.0-android31.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-1.8.10.jar:kotlin/internal/jdk7/JDK7PlatformImplementations$ReflectSdkVersion.class, \.nuget\packages\xamarin.kotlin.stdlib.jdk7\1.7.20.1\buildTransitive\net6.0-android31.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-jdk7-1.7.20.jar:kotlin/internal/jdk7/JDK7PlatformImplementations$ReflectSdkVersion.class
java.exe error JAVA0000: Compilation failed
 java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: \.nuget\packages\xamarin.kotlin.stdlib\1.8.10\buildTransitive\net6.0-android31.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-1.8.10.jar
2>MSBUILD : java.exe error JAVA0000: kotlin/internal/jdk7/JDK7PlatformImplementations$ReflectSdkVersion.class
Followed by hundreds of warnings such as:
2>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP_PREFIX
2>JAVAC : warning : unknown enum constant Scope.LIBRARY
2>JAVAC : warning : unknown enum constant Scope.LIBRARY
2>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP_PREFIX

Steps to Reproduce

I still can't start my app that worked on Xamarin.Forms so... hard to give exact steps, i'm in the middle of migration.
These are my csproj settings for Android:

 <Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
 <OutputType>Exe</OutputType>
 <PublishTrimmed>true</PublishTrimmed>
 <TrimMode>link</TrimMode>
 <ImplicitUsings>enable</ImplicitUsings>
 <UseMaui>true</UseMaui>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">29.0</SupportedOSPlatformVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <EnableLLVM>true</EnableLLVM>
     <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
     <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
     <!-- Didn't affect the outcome
     <AndroidDexTool>d8</AndroidDexTool>
     <AndroidLinkTool>r8</AndroidLinkTool>-->
     <AndroidPackageFormat>aab</AndroidPackageFormat>
     <AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
   </PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>net7.0-android</TargetFrameworks>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-android|AnyCPU'">
     <Optimize>True</Optimize>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-android|AnyCPU'" />
   <ItemGroup>
     <PackageReference Include="CommunityToolkit.Maui.Markup" Version="3.1.0" />
     <PackageReference Include="FirebaseAuthentication.net">
       <Version>4.0.2</Version>
     </PackageReference>
     <PackageReference Include="Refractored.MvvmHelpers" Version="1.6.2" />
     <PackageReference Include="sqlite-net-pcl">
       <Version>1.8.116</Version>
     </PackageReference>
     <PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.6.0.1" />
     <PackageReference Include="Xamarin.AndroidX.RecyclerView">
       <Version>1.3.0</Version>
     </PackageReference>
     <PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
      <PrivateAssets>all</PrivateAssets>
     </PackageReference>
     <PackageReference Include="Xamarin.AndroidX.Work.Runtime" Version="2.7.1.5" />
     <PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.1.0" />
</ItemGroup>
<ItemGroup>
<GoogleServicesJson Include="google-services.json" />
<!--<ProguardConfiguration Include="proguard.cfg" />-->
</ItemGroup>
</Project>

Link to public reproduction project repository

N/A

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

nope

Relevant log output

No response

@ppiekarski2 ppiekarski2 added the t/bug Something isn't working label May 6, 2023
@ppiekarski2
Copy link
Author

Found additional 'reason' for missing enum issue:

C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@\AppData\Local\Temp\tmpE00E.tmp" -target 1.8 -source 1.8
2>        JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP_PREFIX
2>          reason: class file for androidx.annotation.RestrictTo$Scope not found

@Eilon Eilon added platform/android 🤖 area-core-platform Integration with platforms labels Jun 20, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 7, 2023
@moljac
Copy link
Contributor

moljac commented Nov 12, 2023

Related:

#18665

#17935

#16448

@moljac
Copy link
Contributor

moljac commented Nov 13, 2023

net.7.0 worx on my box

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">
			$(TargetFrameworks);net7.0-android
		</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">
			$(TargetFrameworks);net7.0-android;net7.0-ios;net7.0-maccatalyst
		</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">
			$(TargetFrameworks);net7.0-windows10.0.19041.0
		</TargetFrameworks>
		<!-- 
			Uncomment to also build the tizen app. 
			install tizen by following this: https://github.com/Samsung/Tizen.NET 
		-->
		<!--
		<TargetFrameworks>
			$(TargetFrameworks);net6.0-tizen
		</TargetFrameworks>
		-->
	</PropertyGroup>

	<PropertyGroup>
		<OutputType>Exe</OutputType>
        <RootNamespace>AppMAUI.DemoSample</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>AppMAUI.DemoSample</ApplicationTitle>

		<!-- App Identifier -->
        <ApplicationId>net.holisticware.appmaui</ApplicationId>
		<ApplicationIdGuid>e27866ff-49ae-4be3-9896-0f5afbbbacdc</ApplicationIdGuid>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>
	</PropertyGroup>

	<PropertyGroup>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
		<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
	  <CreatePackage>false</CreatePackage>
	</PropertyGroup>

	<ItemGroup>
		<!--
			https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-watch
		-->
		<Watch Include="**\*.razor" />
		<Watch Include="**\*.js" Exclude="node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
		<Compile Update="Generated.cs" Watch="false" />
		<EmbeddedResource Update="Strings.resx" Watch="false" />
	</ItemGroup>

	<ItemGroup>
		<!-- App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

		<!-- Splash Screen -->
		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

		<!-- Images -->
		<MauiImage Include="Resources\Images\*" />
		<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
	</ItemGroup>

    <!-- 
        Condition="$(TargetFramework.EndsWith('-android'))"
        Condition="$(TargetFramework.EndsWith('-android'))"
    -->
    <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
        <PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.7.0.2" />
        <PackageReference Include="Xamarin.AndroidX.RecyclerView">
        <Version>1.3.2</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.Work.Runtime" Version="2.8.1.5" />
        <PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.2.0.4" />
        <!--
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605: Warning As Error: Detected package downgrade: Xamarin.AndroidX.Lifecycle.LiveData from 2.6.2.2 to 2.5.1.1. Reference the package directly from the project to select a different version.  [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605:  MauiApp2 -> Xamarin.AndroidX.Work.Runtime 2.8.1.5 -> Xamarin.AndroidX.Lifecycle.LiveData (>= 2.6.2.2)  [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605:  MauiApp2 -> Xamarin.AndroidX.Lifecycle.LiveData (>= 2.5.1.1) [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]


        /usr/local/share/dotnet/sdk/8.0.100-rc.2.23502.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(152,5): warning NETSDK1023: A PackageReference for 'Xamarin.AndroidX.Lifecycle.LiveData' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        -->
         <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.6.2.2" />

        <!-- 
        MSBUILD : java error JAVA0000: Error in $HOME/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        MSBUILD : java error JAVA0000: Type androidx.collection.ArrayMapKt is defined multiple times: $HOME/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, $HOME/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.5/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]

        -->
        <PackageReference Include="Xamarin.AndroidX.Fragment.Ktx">
            <Version>1.6.2</Version>
        </PackageReference>

        <!--
        MSBUILD : java error JAVA0000: Error in obj/Debug/net7.0-android/lp/175/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class: [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        MSBUILD : java error JAVA0000: Type com.google.android.gms.actions.ReserveIntents is defined multiple times: obj/Debug/net7.0-android/lp/175/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class, obj/Debug/net7.0-android/lp/177/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        -->
        <PackageReference Include="Xamarin.AndroidX.Activity" Version="1.8.0.1" />
        <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />        
    </ItemGroup>
    <ItemGroup>
        <PackageReference Include="CommunityToolkit.Maui.Markup" Version="3.3.0" />
        <PackageReference Include="FirebaseAuthentication.net">
          <Version>4.1.0</Version>
        </PackageReference>
        <PackageReference Include="Refractored.MvvmHelpers" Version="1.6.2" />
        <PackageReference Include="sqlite-net-pcl">
          <Version>1.8.116</Version>
        </PackageReference>
        <PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
         <PrivateAssets>all</PrivateAssets>
        </PackageReference>        
    </ItemGroup>

</Project>

@moljac
Copy link
Contributor

moljac commented Nov 13, 2023

net.8.0 worx on my box

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks 
			Condition="$([MSBuild]::IsOSPlatform('linux'))"
			>
			$(TargetFrameworks);net8.0-android
		</TargetFrameworks>
		<TargetFrameworks 
			Condition="$([MSBuild]::IsOSPlatform('osx'))"
			>
			$(TargetFrameworks);net8.0-android;net8.0-ios;net8.0-maccatalyst
		</TargetFrameworks>
		<TargetFrameworks 
			Condition="$([MSBuild]::IsOSPlatform('windows'))"
			>
			$(TargetFrameworks);net8.0-windows10.0.19041.0
		</TargetFrameworks>
		<!-- 
			Uncomment to also build the tizen app. 
			install tizen by following this: https://github.com/Samsung/Tizen.NET 
		-->
		<!--
		<TargetFrameworks>
			$(TargetFrameworks);net6.0-tizen
		</TargetFrameworks>
		-->
	</PropertyGroup>

	<PropertyGroup>
		<!-- Note for MacCatalyst:
		The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
		When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifer>.
		The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
		either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
		<!-- ex. <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

		<OutputType>Exe</OutputType>
		<RootNamespace>ProjectsStructureTemplate.AppMAUI.DemoSample</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>ProjectsStructureTemplate.AppMAUI.DemoSample</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>com.companyname.projectsstructuretemplate.appmaui.demosample</ApplicationId>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
		<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
	</PropertyGroup>

	<ItemGroup>
		<!-- App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

		<!-- Splash Screen -->
		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

		<!-- Images -->
		<MauiImage Include="Resources\Images\*" />
		<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.1.23419.4" />
	</ItemGroup>

	<!-- Build Properties must be defined within these property groups to ensure successful publishing
       to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
  </PropertyGroup>

  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
    <UseHardenedRuntime>true</UseHardenedRuntime>
  </PropertyGroup>

    <!-- 
        Condition="$(TargetFramework.EndsWith('-android'))"
        Condition="$(TargetFramework.EndsWith('-android'))"
    -->
    <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
        <PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.7.0.2" />
        <PackageReference Include="Xamarin.AndroidX.RecyclerView">
        <Version>1.3.2</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.Work.Runtime" Version="2.8.1.5" />
        <PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.2.0.4" />
        <!--
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605: Warning As Error: Detected package downgrade: Xamarin.AndroidX.Lifecycle.LiveData from 2.6.2.2 to 2.5.1.1. Reference the package directly from the project to select a different version.  [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605:  MauiApp2 -> Xamarin.AndroidX.Work.Runtime 2.8.1.5 -> Xamarin.AndroidX.Lifecycle.LiveData (>= 2.6.2.2)  [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]
        ./14954/net7.0/MauiApp2/MauiApp2.csproj : error NU1605:  MauiApp2 -> Xamarin.AndroidX.Lifecycle.LiveData (>= 2.5.1.1) [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.sln]


        /usr/local/share/dotnet/sdk/8.0.100-rc.2.23502.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(152,5): warning NETSDK1023: A PackageReference for 'Xamarin.AndroidX.Lifecycle.LiveData' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        -->
         <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.6.2.2" />

        <!-- 
        MSBUILD : java error JAVA0000: Error in $HOME/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        MSBUILD : java error JAVA0000: Type androidx.collection.ArrayMapKt is defined multiple times: $HOME/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, $HOME/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.5/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]

        -->
        <PackageReference Include="Xamarin.AndroidX.Fragment.Ktx">
            <Version>1.6.2</Version>
        </PackageReference>

        <!--
        MSBUILD : java error JAVA0000: Error in obj/Debug/net7.0-android/lp/175/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class: [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        MSBUILD : java error JAVA0000: Type com.google.android.gms.actions.ReserveIntents is defined multiple times: obj/Debug/net7.0-android/lp/175/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class, obj/Debug/net7.0-android/lp/177/jl/classes.jar:com/google/android/gms/actions/ReserveIntents.class [$HOME/Downloads/14954/net7.0/MauiApp2/MauiApp2.csproj::TargetFramework=net7.0-android]
        -->
        <PackageReference Include="Xamarin.AndroidX.Activity" Version="1.8.0.1" />
        <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />        
    </ItemGroup>
    <ItemGroup>
        <PackageReference Include="CommunityToolkit.Maui.Markup" Version="3.3.0" />
        <PackageReference Include="FirebaseAuthentication.net">
          <Version>4.1.0</Version>
        </PackageReference>
        <PackageReference Include="Refractored.MvvmHelpers" Version="1.6.2" />
        <PackageReference Include="sqlite-net-pcl">
          <Version>1.8.116</Version>
        </PackageReference>
        <PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
         <PrivateAssets>all</PrivateAssets>
        </PackageReference>        
    </ItemGroup>

</Project>

@moljac
Copy link
Contributor

moljac commented Nov 13, 2023

@ppiekarski2

Thanks for the report and I am sorry for delay. I tried to workaround your issue for Android only - both net7.0 and net8.0.

If that works please report here and close the issue.

I will write rundown how I fixed it....

You can get some info and feeling from here

xamarin/AndroidX#764

@moljac
Copy link
Contributor

moljac commented Feb 10, 2024

I suggest to close this issue.

Workarounds were provided, but no feedback so far.

@moljac
Copy link
Contributor

moljac commented Feb 16, 2024

Closing this issue. Workaround provided and no feedback provided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-core-platform Integration with platforms platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants