-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
Found additional 'reason' for missing enum issue:
|
<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> |
<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> |
Thanks for the report and I am sorry for delay. I tried to workaround your issue for Android only - both 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 |
I suggest to close this issue. Workarounds were provided, but no feedback so far. |
Closing this issue. Workaround provided and no feedback provided. |
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:
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:
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
The text was updated successfully, but these errors were encountered: