xamarin / GooglePlayServicesComponents

Other
314 stars 146 forks source link

[Android] Warnings during compilation when adding Xamarin.Google.MLKit.BarcodeScanning #819

Closed riccardominato closed 7 months ago

riccardominato commented 1 year ago

Xamarin.Android Version (eg: 6.0):

Xamarin.Android 13.2.2.0 and .NET MAUI 8.0.3 (different environment, same warnings)

Operating System & Version (eg: Mac OSX 10.11):

Mac OSX 13.6.1 (22G313)

Google Play Services Version

Xamarin.Google.MLKit.BarcodeScanning (versions 117.0.2.2 and later)

Describe your Issue

When I add the nuget package above, these warnings are shown during compilation.

0>libbarhopper_v3.so: Warning XA4301 : L'APK contiene già l'elemento lib/armeabi-v7a/libbarhopper_v3.so. Verrà ignorato.
0>libbarhopper_v3.so: Warning XA4301 : L'APK contiene già l'elemento lib/x86/libbarhopper_v3.so. Verrà ignorato.
0>libbarhopper_v3.so: Warning XA4301 : L'APK contiene già l'elemento lib/arm64-v8a/libbarhopper_v3.so. Verrà ignorato.
0>libbarhopper_v3.so: Warning XA4301 : L'APK contiene già l'elemento lib/x86_64/libbarhopper_v3.so. Verrà ignorato.

They're in italian. They roughly say "The APK already contains the element [file.so]. It will be ignored".

Relevant information

Add relevant project settings from *.csproj file:

Packages used:

<PackageReference Include="Camera.MAUI" Version="1.4.4" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<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" />

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
    <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
    <PackageReference Include="Xamarin.Google.MLKit.BarcodeScanning" Version="117.2.0.2" />
</ItemGroup>

Build settings (tools)

Default build settings for MAUI

Steps to Reproduce (with link to sample solution if possible):

Create a .NET MAUI or Xamarin.Android app, add the nuget package and compile.

moljac commented 1 year ago

@riccardominato

Thanks for the feedback, but this is quite normal and OK. Your sample is real world sample.

2 packages might end up using the same nuget/maven package... Which one? Not sure.

find 819 -iname "libbarhopper_v3.so" 
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/194/jl/jni/armeabi-v7a/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/194/jl/jni/x86/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/194/jl/jni/arm64-v8a/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/194/jl/jni/x86_64/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/214/jl/jni/armeabi-v7a/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/214/jl/jni/x86/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/214/jl/jni/arm64-v8a/libbarhopper_v3.so
819/AppMAUI.Issue819/obj/Debug/net8.0-android/lp/214/jl/jni/x86_64/libbarhopper_v3.so

194 - barcode-scanning-common.aar

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.mlkit.vision.barcode.bundled" >

    <uses-sdk android:minSdkVersion="19" />

</manifest>

214 - playservicesmlkitbarcodescanning-18.3.0.aar

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.mlkit.vision.barcode.bundled" >

    <uses-sdk android:minSdkVersion="19" />

</manifest>