Closed FANMixco closed 4 months ago
It works perfectly with the old libs:
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.60" />
<PackageReference Include="PicoXLSX" Version="3.2.1" />
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
<PackageReference Include="Plugin.InAppBilling" Version="7.1.0" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="Xamarin-FiveStarsRate" Version="4.1.0" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.10" />
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.2" />
<PackageReference Include="Xamarin.AndroidX.DrawerLayout" Version="1.2.0.10" />
<PackageReference Include="Xamarin.AndroidX.Preference" Version="1.2.1.7" />
</ItemGroup>
Hi guys,
I got the same issue today after updating some packages, specifically InAppBilling, from 7.1.0 to 7.1.2. I could solve the issue by uninstalling it and installing back 7.1.0 for now...
The full output is:
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\AndroidManifest.xml(12,196): error AMM0000: C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\185\jl\AndroidManifest.xml Warning:
Namespace 'com.android.billingclient' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\194\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.base' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\187\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.encoders.json' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\195\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.common' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\196\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.location' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\lp\197\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.tasks' used in: AndroidManifest.xml, AndroidManifest.xml.
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\AndroidManifest.xml:12:196-220 Error:
Attribute application@label value=(MauiApp4) from AndroidManifest.xml:12:196-220
is also present at AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:12:3-31:17 to override.
Directory 'obj\Debug\net8.0-android\lp\185' is from 'billing.aar'.
Directory 'obj\Debug\net8.0-android\lp\194' is from 'play-services-base.aar'.
Directory 'obj\Debug\net8.0-android\lp\187' is from 'firebase-encoders-json.aar'.
Directory 'obj\Debug\net8.0-android\lp\195' is from 'play-services-basement.aar'.
Directory 'obj\Debug\net8.0-android\lp\196' is from 'play-services-location.aar'.
Directory 'obj\Debug\net8.0-android\lp\197' is from 'play-services-tasks.aar'.
Specifically:
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\AndroidManifest.xml:12:196-220 Error:
Attribute application@label value=(MauiApp4) from AndroidManifest.xml:12:196-220
is also present at AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:12:3-31:17 to override.
Looking for label=
in the /lp
directory only yields a single result:
<!-- net8.0-android\lp\0\jl\AndroidManifest.xml -->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="angtrim.com.fivestarslibrary"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="29" />
<application
android:allowBackup="true"
android:label="@string/app_name" >
</application>
</manifest>
This is from https://www.nuget.org/packages/Xamarin-FiveStarsRate.
I don't see how changing https://www.nuget.org/packages/Plugin.InAppBilling would cause this to start erroring.
@dellis1972 This appears to be an Android Manifest Merger issue. Can you assist here?
Actually, this seems unrelated to BillingClient.
Adding just:
<PackageReference Include="Xamarin-FiveStarsRate" Version="4.1.0" />
to the MAUI template causes the error:
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\AndroidManifest.xml(12,196): error AMM0000:
Attribute application@label value=(MauiApp4) from AndroidManifest.xml:12:196-220
is also present at AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:12:3-29:17 to override.
If you only add:
<PackageReference Include="Plugin.InAppBilling" Version="7.1.2" />
to the MAUI template, you get a different error:
C:\code\temp\MauiApp4\obj\Debug\net8.0-android\AndroidManifest.xml:13:77-98 Error:
Attribute meta-data#com.google.android.play.billingclient.version@value value=(6.0.1) from AndroidManifest.xml:13:77-98
is also present at AndroidManifest.xml:21:13-34 value=(6.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:13:5-101 to override.
This is caused because com.android.billingclient:billing
has updated its version number in the AndroidManifest.xml
it ships:
<!-- billing-6.0.1 -->
<meta-data
android:name="com.google.android.play.billingclient.version"
android:value="6.0.1" />
<!-- billing-6.1.0 -->
<meta-data
android:name="com.google.android.play.billingclient.version"
android:value="6.1.0" />
However, Plugin.InAppBilling
has hardcoded this version as 6.0.1
:
I think Plugin.InAppBilling
will need to do one of the following:
6.2.0
and 7.0.0
as well)[MetaData]
attribute since it appears to come from the .aar
anywaysXamarin.Android.Google.BillingClient
NuGet reference to an exact version rather than letting it floatIt looks like they already have an issue for this: https://github.com/jamesmontemagno/InAppBillingPlugin/issues/615.
The work around is right in the error message.
'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:13:5-101 to override
See https://github.com/dotnet/android/blob/main/Documentation/docs-mobile/building-apps/build-items.md#androidmanifestoverlay and https://developer.android.com/build/manage-manifests
The work around is right in the error message.
Having learned a little bit more about manifests while investigating today, I think it works by default in an .NET for Android application because the attribute values match:
<!-- .NET for Android template value -->
<application android:label="@string/app_name" ... />
<!-- NuGet library value -->
<application
android:allowBackup="true"
android:label="@string/app_name" >
However the MAUI template uses a different android:label
, triggering the error:
<!-- MAUI template value -->
<application android:label="MauiApp4" ... />
Arguably, a NuGet library should not be shipping an AndroidManifest.xml
that is trying to dictate the name of the entire application. 😉
i will remove this and folks should add manually
Xamarin.Android Version (eg: 6.0):
.NET 8
Operating System & Version (eg: Mac OSX 10.11):
Windows 11
Google Play Services Version
[] GPS-FB with AndroidX dependencies (versions
1xx.yyyy.zz
)[] GPS-FB with Android.Support (legacy) dependencies (versions
71.yyyy.zz
)Describe your Issue
Relevant information
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: