Closed williambuchanan2 closed 4 months ago
seeing the same error, 118.4.3 is the last working one, 118.4.3.1, 118.5.1 and 118.5.1.1 throw this error. (Maui - net8-android)
@williambuchanan2 @hellcoderGIT
Thanks for the feedback. Can you provide minimal repro sample please?
And lucky shot attempt:
try adding
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.3.0.2" />
try adding
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.3.0.2" />
@moljac
I added that but it didn't work. In fact it just caused another build problem.
Error JAVA0000 Error in C:\Ws_ng\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class: Type androidx.collection.ArrayMapKt is defined multiple times
adding Xamarin.AndroidX.Collection(.Ktx) fixed it for me:
`
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx">
<Version>1.3.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Analytics">
<Version>121.3.0.4</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Crashlytics">
<Version>118.5.1.1</Version>
</PackageReference>
</ItemGroup>`
Well done @hellcoderGIT !
It looks like nuget doesn't realise those dependencies are required. I had to add this in to my project and then manually update the version number in the csproj files because nuget was failing to do that as well.
<PackageReference Include="Xamarin.AndroidX.Collection"><Version>1.3.0.2</Version></PackageReference>
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx"><Version>1.3.0.2</Version></PackageReference>
I added that but it didn't work.
Possibly. It transitive depends on ALL depenencies of ALL PackageReference
s in your project. It gets worse with 3rd party packages (like plugins) which are not updated regularly.
The problem is that google moves types from artifact to artifact in different versions.
This issue will give you more insights into the problem
https://github.com/xamarin/AndroidX/issues/764
In fact it just caused another build problem.
Error JAVA0000 Error in C:\Ws_ng\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class: Type androidx.collection.ArrayMapKt is defined multiple times
No. It is the same problem, but different nuget constellation.
Well done @hellcoderGIT !
maybe his app was a bit less complex and that simple trick worked.
It looks like nuget doesn't realise those dependencies are required.
Nuget does realise and if you check dependency tree you will see that those are referenced. It could be that there is 2+ versions of the same package.
I had to add this in to my project and then manually update the version number in the csproj files because nuget was failing to do that as well.
Again. Nuget does everything right. What you did is - you actually told nuget to forget all other packages and override them with versions you specified - (explicit reference).
<PackageReference Include="Xamarin.AndroidX.Collection"><Version>1.3.0.2</Version></PackageReference> <PackageReference Include="Xamarin.AndroidX.Collection.Ktx"><Version>1.3.0.2</Version></PackageReference>
Did this addition help?
Again. Nuget does everything right. What you did is - you actually told nuget to forget all other packages and override them with versions you specified - (explicit reference). Did this addition help?
Not sure I understand what you are saying. From my perspective Nuget should just work. I shouldn't need to manually edit files. In this case Nuget wasn't working. It wasn't including the dependencies. I didn't exclude anything - it just didn't work.
In fact the same problem occurred yesterday with the latest AndroidX packages. Same thing again - Nuget was failing to update them so I had to manually edit the csproj.
If you can see that I have done something to cause that let me know - but as I said I expect it to just work without me needing to do extra work.
Nuget works, but it works differently from Maven and you are using packages with Maven artifact bindings.
For the reason above- sometimes some manual work is necessary.
Closing this issue
Nuget works, but it works differently from Maven and you are using packages with Maven artifact bindings.
For the reason above- sometimes some manual work is necessary.
Closing this issue
On Feb 14 you said Nuget does everything right. Today you are saying manual work is necessary. Which is it? If manual work is necessary then in my mind something isn't right. Clearly i'm not the only person having problems with this package.
Xamarin.Android Version (eg: 6.0):
Operating System & Version (eg: Mac OSX 10.11):
Windows
Google Play Services Version
118.2.0.4
[] GPS-FB with AndroidX dependencies (versions
1xx.yyyy.zz
)[] GPS-FB with Android.Support (legacy) dependencies (versions
71.yyyy.zz
)Describe your Issue
Get a build error:
Error JAVA0000 Error in C:\Ws_ng\xamarin.androidx.collection.jvm\1.3.0.1\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class
Relevant information
Building .NET Maui app in Visual Studio. Worked ok in earlier version. Problem exists in .NET 7 and .NET 8.
Add relevant project settings from
*.csproj
file:Packages used:
Build settings (tools)
or even better - links to the existing code:
https://github.com/xamarin/AndroidX/blob/master/samples/BuildAll/BuildAll/BuildAll.csproj#L41-L44
https://github.com/xamarin/AndroidX/blob/master/samples/BuildXamarinFormsApp/BuildXamarinFormsApp/BuildXamarinFormsApp.Android/BuildXamarinFormsApp.Android.csproj#L57-L58
NOTE: Please DO NOT submit screenshot images. Images are not searchable!
Minimal Repro Code Sample
If you want to speed up investigation and bug fixing: please provide minimal repro sample for tests.
Steps to Reproduce (with link to sample solution if possible):
Include any relevant Exception Stack traces, build logs, adb logs: