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

Type androidx.collection.ArrayMapKt is defined multiple times #517

Closed
Calichi opened this issue Aug 25, 2024 · 7 comments
Closed

Type androidx.collection.ArrayMapKt is defined multiple times #517

Calichi opened this issue Aug 25, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Calichi
Copy link

Calichi commented Aug 25, 2024

When debugging on a physical Android device from VSCode, I get the following exception.

Exception:

Type androidx.collection.ArrayMapKt is defined multiple times

Steps to reproduce the behavior:

1. Install the package plugin.LocalNotification_v11.1.4.
2. Start debugging the project

Additional information

I am debugging a MAUI app intended for Android on a physical mobile device with OS (Android 10).

Version 10.1.8 of the mentioned package plugin.LocalNotification does not produce this issue and integrates correctly.

@Calichi Calichi added the bug Something isn't working label Aug 25, 2024
@Spartananator
Copy link

I am also having this issue when trying to build / debug a project to a android 14.0 API 34 android emulator build. I am running plugin v 11.1.4

@darshanio
Copy link

@darshanio
Copy link

Downgrading to 11.1.3 fixed the compilation issues.

@Kaayo
Copy link

Kaayo commented Sep 19, 2024

Hello,
I had the same problem here, I'm using .NET 8 and Maui Blazor, I managed to solve it by manually installing these packages in their latest versions:

 Xamarin.AndroidX.Collection = 1.4.3.1
 Xamarin.AndroidX.Collection.Jvm = 1.4.3.1
 Xamarin.AndroidX.Collection.Ktx = 1.4.3.1
 Xamarin.AndroidX.Preference = 1.2.1.10

@RobertHassfeld
Copy link

RobertHassfeld commented Sep 24, 2024

@Calichi Hi, I had the same issue as you.

But I need the 11.1.4 because of this issue: #465

My solution works when I installed this Nugets.

<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.5"/>
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.5"/>
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.5"/>
<PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.7.0.2" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.7.0.4" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" />

@RobDaytona
Copy link

RobDaytona commented Oct 3, 2024

THIS NUGET FAILS RIGHT OUT THE BOX ON A FRESH INSTALL.
STEPS TO REPRODUCE
1 - Create Brand New Maui App, (do not select the version with multiple projects per platform).
2 - Install [Plugin.LocalNotification] nuget
3 - Build:
Build Fails:
MSBUILD : java.exe error JAVA0000: Error in <test_path>/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class:
MSBUILD : java.exe error JAVA0000: Type androidx.collection.ArraySetKt is defined multiple times:
<test_path>/xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar,
<test_path>/xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar
MSBUILD : java.exe error JAVA0000: Compilation failed

@Elvin-Thudugala-2degrees

Please follow instructions in https://github.com/thudugala/Plugin.LocalNotification/releases/tag/v11.1.4

Make sure to Add these Package Reference for android

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
  <PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime.Ktx" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel.Ktx" Version="2.8.3" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModelSavedState" Version="2.8.3" />
</ItemGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants