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

Upgrading xamarin-android to .Net8.0 - Error AMM0000 #8842

Open
rj-jpl opened this issue Mar 27, 2024 · 3 comments
Open

Upgrading xamarin-android to .Net8.0 - Error AMM0000 #8842

rj-jpl opened this issue Mar 27, 2024 · 3 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review

Comments

@rj-jpl
Copy link

rj-jpl commented Mar 27, 2024

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

VS 2022 Version 17.9.3

Description

I am trying to upgrade our current Xamarin.Android project to a .Net8.0
https://learn.microsoft.com/en-us/dotnet/maui/migration/android-projects?view=net-maui-8.0

I am getting the following error:

AndroidManifest.xml(28,18): java.exe error AMM0000: C:\..........\obj\Debug\net8.0-android\lp\118\jl\AndroidManifest.xml Warning:
AndroidManifest.xml(28,18): java.exe error AMM0000: 	Namespace 'androidx.versionedparcelable' used in: AndroidManifest.xml, AndroidManifest.xml.
AndroidManifest.xml(28,18): java.exe error AMM0000: 
AndroidManifest.xml(28,18): java.exe error AMM0000: 	Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:28:18-86
AndroidManifest.xml(28,18): java.exe error AMM0000: 	is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
AndroidManifest.xml(28,18): java.exe error AMM0000: 	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:16:3-46:17 to override.
AndroidManifest.xml(28,18): java.exe error AMM0000: Directory 'obj\Debug\net8.0-android\lp\118' is from 'androidx.versionedparcelable.versionedparcelable.aar'.

I have spent several days to find the root cause but I had no success. We only have one AndroidManifest.xml file and I was not able to find any other AndroidManifest.xml file in the whole solution folder. So basically I am stuck now and any help is greatly appreciated.

Thanks

Steps to Reproduce

I don't think it easy for anyone to reproduce this issue because it seems to be related to our application settings and configuration regarding the NuGet packages or other reasons.

Did you find any workaround?

No workaround available.

Relevant log output

No response

@rj-jpl rj-jpl added the needs-triage Issues that need to be assigned. label Mar 27, 2024
@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. and removed needs-triage Issues that need to be assigned. labels Mar 27, 2024
@jpobst jpobst assigned dellis1972 and jonathanpeppers and unassigned jpobst Mar 27, 2024
@jonathanpeppers
Copy link
Member

Can you share a .binlog file that contains the error? https://aka.ms/binlog

@jonathanpeppers jonathanpeppers added the need-info Issues that need more information from the author. label Mar 27, 2024
@rj-jpl
Copy link
Author

rj-jpl commented Mar 27, 2024

Hi Jonathan,
Thanks for looking at this. I am not sure if I can share the build log file in here. I have asked for a permission.
However, in case I could not share that with you, is there any place I need to look at in the hope of finding the root cause?
Thank you!

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Mar 27, 2024
@jonathanpeppers
Copy link
Member

The error message suggests:

AndroidManifest.xml(28,18): java.exe error AMM0000: 	Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:28:18-86
AndroidManifest.xml(28,18): java.exe error AMM0000: 	is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
AndroidManifest.xml(28,18): java.exe error AMM0000: 	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:16:3-46:17 to override.
AndroidManifest.xml(28,18): java.exe error AMM0000: Directory 'obj\Debug\net8.0-android\lp\118' is from 'androidx.versionedparcelable.versionedparcelable.aar'.

Both androidx.versionedparceable and androidx.support.v4 have duplicate AndroidManifest.xml values. Can you completely remove any V4 Nuget packages? (Or update to latest?)

A lot of times apps are using this package, but don't actually need it:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review
Projects
None yet
Development

No branches or pull requests

4 participants