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

Net7 and Net8 Android projects with AndroidLibrary try to generate binding instead of add it as reference like Xamarin project does #8609

Closed
rfrailemartinez opened this issue Dec 23, 2023 · 27 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

@rfrailemartinez
Copy link

Android application type

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

Affected platform version

Net 7 and Net 8

Description

We have somo bindings of libraries that references other libraries. In Xamarin projects we only make binding of the principal aar file, like libraryProjectZip, the one that we want to exponse methods to our code. This project is added to the final project as rejerence or as nuget. The rest of the libraries we added to final project as AndroidLibrary, when we compile the project, this files are visible for the java virtual machine and everithing works ok.

In new Net 8 or 7 android project, if you mark a aar file as AndroidLibrary, in spite of doing the same as Xamarin Android project, it try to generate a Android binding of the file and report the same errors that you have if you create a binding project.

We expect tp have the same behavoir that we have in Xmarin projects:

if is a binding project, try to generate binding an expose all methods
if is a Android porject, expose this file to JVM.
This problem make us impossible to migrate lot of projects that we jave with native bindings.

Steps to Reproduce

Create a Net 8 Android project
Add aar file
Compile project
you will see the same errors as if you put this file in a Net 8 Android Binding Project

Did you find any workaround?

No response

Relevant log output

For example for glide-4.16.0.aar, we have this errors
Gravedad	Código	Descripción	Proyecto	Archivo	Línea	Estado suprimido
Error	CS0534	'AssetFileDescriptorLocalUriFetcher' no implementa el miembro abstracto heredado 'LocalUriFetcher.Close(Object?)'	TestNet	...\obj\Debug\net8.0-android\generated\src\Com.Bumptech.Glide.Load.Data.AssetFileDescriptorLocalUriFetcher.cs	20	Activo
Error	CS0534	'AssetFileDescriptorLocalUriFetcher' no implementa el miembro abstracto heredado 'LocalUriFetcher.LoadResource(Uri?, ContentResolver?)'	TestNet	...\obj\Debug\net8.0-android\generated\src\Com.Bumptech.Glide.Load.Data.AssetFileDescriptorLocalUriFetcher.cs	20	Activo
Error	CS0534	'FileDescriptorAssetPathFetcher' no implementa el miembro abstracto heredado 'AssetPathFetcher.Close(Object?)'	TestNet	...\obj\Debug\net8.0-android\generated\src\Com.Bumptech.Glide.Load.Data.FileDescriptorAssetPathFetcher.cs	20	Activo
Error	CS0534	'FileDescriptorAssetPathFetcher' no implementa el miembro abstracto heredado 'AssetPathFetcher.LoadResource(AssetManager?, string?)'	TestNet	...\obj\Debug\net8.0-android\generated\src\Com.Bumptech.Glide.Load.Data.FileDescriptorAssetPathFetcher.cs	20	Activo
Error	CS0534	'FileDescriptorLocalUriFetcher' no implementa el miembro abstracto heredado 'LocalUriFetcher.Close(Object?)'	TestNet	
...

Same errors that you recive if you try to make a binding library project.
@jpobst
Copy link
Contributor

jpobst commented Dec 23, 2023

If you just want to reference your Java library but not generate a binding for it you'll need to add Bind='false' to the <AndroidLibrary> element, like this:

<AndroidLibrary Include='library.aar' Bind='false' />

More info on the available options is available here:
https://learn.microsoft.com/en-us/dotnet/maui/migration/android-binding-projects?view=net-maui-8.0#new-item-group-names

@rfrailemartinez
Copy link
Author

Hello @jpobst,
First of all thank you very much

I tried with bind=false, using inlude and update,

with include bind=false is ignored and have the same errors that we had when we didn´t put bind
Captura de pantalla 2023-12-23 210814
Captura de pantalla 2023-12-23 210821

with update I have different errors but all of them refers to styles that are in those library files
Captura de pantalla 2023-12-23 210656
Captura de pantalla 2023-12-23 210618

What do you thing we are doing wrong?

thank your for your support.

@jpobst
Copy link
Contributor

jpobst commented Dec 23, 2023

Update is likely correct, because the libraries are already being included with the "default includes".

I'm afraid resources and packaging are out of my area of expertise. The original assignees of this issue are the best people to help, likely after the holidays.

@rfrailemartinez
Copy link
Author

Thank you anyway @jpobst for your quickly answer and support
I expect the original assignees could help us soon, but we understand the dates.

@jonathanpeppers
Copy link
Member

Update is correct if the default wildcards are including the files. Generally, you can drop a .jar or .aar in your project folder and it will default to creating a C# binding and including the java library in the project.

So, this should be what you would do for no C# binding:

<AndroidLibrary Update="foo.aar" Bind="false" />

@rfrailemartinez can you share a .binlog of the latest errors using Update? https://aka.ms/binlog

@jonathanpeppers jonathanpeppers added need-info Issues that need more information from the author. and removed needs-triage Issues that need to be assigned. labels Jan 3, 2024
@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Jan 3, 2024
@rfrailemartinez
Copy link
Author

Hello @jpobst ,
Thanks for your support

binlog.zip
Binlog files added

Compile is ok, implementation generates the error,
This is some output info:
Compilación del proyecto "TestNet.csproj" terminada.
Aplicando tarea Touch a "obj\Debug
et8.0-android34.0\stamp_GenerateJavaStubs.stamp".
C:\Program Files (x86)\Android\openjdk\jdk-17.0.8.101-hotspot\bin\java.exe -cp "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\manifestmerger.jar" com.xamarin.manifestmerger.Main obj\Debug
et8.0-android34.0\android\manifestmerger.rsp
Se omitirá el destino "_ConvertCustomView" porque todos los archivos de salida están actualizados respecto a los archivos de entrada.
Copiando el archivo de "C:\Program Files\dotnet\packs\Microsoft.Android.Ref.34\34.0.43\ref
et8.0\mono.android.jar" en "C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug
et8.0-android34.0\android\bin\mono.android.jar".
Aplicando tarea Touch a "obj\Debug
et8.0-android34.0\android\bin\mono.android.jar".
Aplicando tarea Touch a "obj\Debug
et8.0-android34.0\static.flag".
Aplicando tarea Touch a "obj\Debug
et8.0-android34.0\stamp_GeneratePackageManagerJava.stamp".
Se omitirá el destino "_GenerateAndroidAssetsDir" porque no tiene salidas.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDMaterialComponentsTheme.TransparentActivity (aka com.minsait.testveridas:style/VDMaterialComponentsTheme.TransparentActivity) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDPhotoSelfieCaptureTheme.NoTitle (aka com.minsait.testveridas:style/VDPhotoSelfieCaptureTheme.NoTitle) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDPhotoSelfieCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDPhotoSelfieCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDPhotoSelfieCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDPhotoSelfieCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDVideoSelfieCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDVideoSelfieCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDVideoSelfieCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDVideoSelfieCaptureTheme.NoTitleNavBar) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDVideoSelfieCaptureTheme.NoTitle (aka com.minsait.testveridas:style/VDVideoSelfieCaptureTheme.NoTitle) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2260: resource style/VDVideoSelfieCaptureTheme.NoTitle (aka com.minsait.testveridas:style/VDVideoSelfieCaptureTheme.NoTitle) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
APT2067: failed processing manifest.

Compilación del proyecto "TestNet.csproj" terminada -- ERROR.
ERROR al compilar.
3>Error de implementación en nexus_7_-_api_32.
3>Error en la operación Implementar
========== Compilación: 2 correcto, 0 erróneo, 0 actualizado, 0 omitido ==========
========== Compilar completado a las 21:34 y tardó 56,182 segundos ==========
========== Implementación: 0 correcta, 1 con errores, 0 omitido ===========
========== Implementar completado a las 21:34 y tardó 56,182 segundos ==========

@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 Jan 3, 2024
@jonathanpeppers
Copy link
Member

If we look at the first error:

APT2260: resource style/VDDocumentCaptureTheme.NoTitleNavBar (aka com.minsait.testveridas:style/VDDocumentCaptureTheme.NoTitleNavBar) not found.

What .aar contains an Android style named NoTitleNavBar? It feels like it is missing from the application being built.

Is it one of the .aar files you included in your project, but it's not making it to the application?

@rfrailemartinez
Copy link
Author

Hi @jonathanpeppers,

if I open "VDDocumentCapture.aar" file with zip,
In values.xml I had

<style name="VDDocumentCaptureTheme.NoTitleNavBar" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:statusBarColor" ns1:targetApi="lollipop">@android:color/transparent
    </item>
    <item name="android:windowTranslucentNavigation" ns1:targetApi="kitkat">true</item>
</style>

This aar is one of the files we have:
<AndroidLibrary Update="Veridas\VDDocumentCapture.aar" Bind="false" />

thanks for your support

@jonathanpeppers
Copy link
Member

From what it looks like, the extracted .aar is:

C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\151\jl\res
    OriginalFile = C:\Indra\Veridas\Veridas\Workspace\TestNet\Veridas\VDDocumentCapture.aar

This res folder isn't passed along:

Task Aapt2Link
AdditionalAndroidResourcePaths
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\97\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\98\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\99\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\100\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\101\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\103\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\104\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\107\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\108\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\109\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\111\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\112\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\113\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\114\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\116\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\117\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\118\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\121\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\123\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\124\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\127\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\128\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\130\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\132\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\133\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\134\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\135\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\136\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\137\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\140\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\141\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\142\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\143\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\149\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\160\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\176\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\177\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\181\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\181\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\183\jl\res
C:\Indra\Veridas\Veridas\Workspace\TestNet\obj\Debug\net8.0-android34.0\lp\183\jl\res

Is there a way we could create a sample project with the same problem? Maybe one that doesn't have 100+ .aar files?

@rfrailemartinez
Copy link
Author

rfrailemartinez commented Jan 4, 2024

Hello @jonathanpeppers,
This is a sample project and it doesn´t have more than 100 aar files

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-android34.0</TargetFramework>
    <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <ApplicationId>com.minsait.testveridas</ApplicationId>
    <ApplicationVersion>1</ApplicationVersion>
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>   
  </PropertyGroup>
  <ItemGroup>
    <AndroidLibrary Update="Veridas\glide-4.16.0.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDDocumentCapture.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDLibraryCommonCore.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDLibraryCommonCoreJvm.jar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDLibraryCommonImageProcessing.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDLogger.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDLoggerFirebase.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDPhotoSelfieCapture_fixed.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\VDVideoSelfieCapture.aar" Bind="false" />
    <AndroidLibrary Update="Veridas\zip4j-2.9.1.jar" Bind="false" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.3" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.6" />
    <PackageReference Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.9" />
    <PackageReference Include="Xamarin.AndroidX.ExifInterface" Version="1.3.6.6" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V13" Version="1.0.0" />
    <PackageReference Include="Xamarin.AndroidX.Lifecycle.Extensions" Version="2.2.0.22" />
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
    <PackageReference Include="Xamarin.Google.Dagger" Version="2.39.1" />
    <PackageReference Include="Xamarin.GooglePlayServices.MLKit.FaceDetection" Version="117.1.0.5" />
    <PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.9.21.1" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\VeridasAndroidNetSDK\VeridasAndroidNetSDK.csproj" />
  </ItemGroup>
</Project>
Captura de pantalla 2024-01-04 094103

Only a MainActivity to test it.

Looking into folder "obj\Debug\net8.0-android34.0\lp" I think most of them are from google

Please, tell me a way to help you, if you want I can try to search the subfolders numbers

Thank for your support

@jonathanpeppers
Copy link
Member

@rfrailemartinez can you share this project as a .zip file here (or on a public GitHub repository)?

@rfrailemartinez
Copy link
Author

Hi @jonathanpeppers,
It is sure that it can not put in public place because in the providers page they only have documentation, not the artifacts. if you want I can ask our providers and share the test project with you by email.

thank you

@jonathanpeppers
Copy link
Member

If you are able, you can use the email address on my GitHub profile. Thanks!

@rfrailemartinez
Copy link
Author

Hello @jonathanpeppers,

I have shared zip file with project to your gmail account.

Thank you

@jonathanpeppers
Copy link
Member

I removed these lines from VeridasAndroidNetSDK\VeridasAndroidNetSDK.csproj, as it doesn't seem like they would be needed:

  <!-- <ItemGroup>
    <AndroidLibrary Remove="Jars\veridas_android_sdk-release.aar" />
  </ItemGroup>
  <ItemGroup>
    <LibraryProjectZip Include="Jars\veridas_android_sdk-release.aar" />
  </ItemGroup> -->

But the test project builds for me even without this change. Should I get an error?

@rfrailemartinez
Copy link
Author

@jonathanpeppers if I remove this lines and remove bin and obj folders of both projects, VeridasAndroidNetSDk.csproj compiles ok, but TestNet stop showing the namespace of this project:
Captura de pantalla 2024-01-05 190435

But if you remove both of them but add:

 <ItemGroup>
   <AndroidLibrary Update="Jars\veridas_android_sdk-release.aar" Bind="true" />
 </ItemGroup>

TestNet works again:

Captura de pantalla 2024-01-05 191112

And then if you start TesTNet we have the same implementation errors

Captura de pantalla 2024-01-05 191218

I don't know why I have to put "AndroidLibrary Update="Jars\veridas_android_sdk-release.aar" Bind="true"", because I think in a Binding project this is the default for this kind of file, or that what I think reading:
https://learn.microsoft.com/en-us/dotnet/maui/migration/android-binding-projects?view=net-maui-8.0#new-item-group-names

@rfrailemartinez
Copy link
Author

Hi @jonathanpeppers,
Any news?
I have finished today the same test and binding projects working with mono-android instead of Net8 using legacy item groups.
Can I help you with something?

thank you

@jonathanpeppers
Copy link
Member

What is an example of what worked and doesn't work using the "new" item groups?

@rfrailemartinez
Copy link
Author

Hello @jonathanpeppers
I don´t know, in both projects we have the same files, same config, but one the first one is with Net8 and android 34, the second one, with mono-android and android 33. The first one has the implementation errors of resources not found, the second one doesn´t have implementation error and works without problems.

mono-android:

<AndroidLibrary Include="Veridas\VDDocumentCapture.aar" />
    <AndroidLibrary Include="Veridas\VDLibraryCommonCore.aar" />
    <AndroidLibrary Include="Veridas\VDLibraryCommonCoreJvm.jar" />
    <AndroidLibrary Include="Veridas\VDLibraryCommonImageProcessing.aar" />
    <AndroidLibrary Include="Veridas\VDLogger.aar" />
    <AndroidLibrary Include="Veridas\VDLoggerFirebase.aar" />
    <AndroidLibrary Include="Veridas\VDPhotoSelfieCapture_fixed.aar" />
    <AndroidLibrary Include="Veridas\glide-4.16.0.aar" />
    <AndroidLibrary Include="Veridas\VDVideoSelfieCapture.aar" />
    <AndroidLibrary Include="Veridas\zip4j-2.9.1.jar" />

Net8:

  <AndroidLibrary Update="Veridas\glide-4.16.0.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDDocumentCapture.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDLibraryCommonCore.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDLibraryCommonCoreJvm.jar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDLibraryCommonImageProcessing.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDLogger.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDLoggerFirebase.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDPhotoSelfieCapture_fixed.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\VDVideoSelfieCapture.aar" Bind="false" />
   <AndroidLibrary Update="Veridas\zip4j-2.9.1.jar" Bind="false" />

References version are not the same because Android 34 requires some new versiones

mono-android:

<ItemGroup>
    <PackageReference Include="VeridasAndroidSDK">
      <Version>1.0.11</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1" />
    <PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
      <Version>2.1.4</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.ExifInterface">
      <Version>1.3.3</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V13">
      <Version>1.0.0</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Lifecycle.Extensions">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.6.1" />
    <PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
    <PackageReference Include="Xamarin.Google.Dagger">
      <Version>2.39.1</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.GooglePlayServices.MLKit.FaceDetection">
      <Version>116.1.7.3</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.Kotlin.StdLib">
      <Version>1.8.20</Version>
    </PackageReference>
  </ItemGroup>

Net8

<ItemGroup>
    <PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.3" />
    <PackageReference Include="VeridasAndroidNetSDK" Version="1.0.11" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.6" />
    <PackageReference Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.9" />
    <PackageReference Include="Xamarin.AndroidX.ExifInterface" Version="1.3.6.6" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V13" Version="1.0.0" />
    <PackageReference Include="Xamarin.AndroidX.Lifecycle.Extensions" Version="2.2.0.22" />
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
    <PackageReference Include="Xamarin.Google.Dagger" Version="2.39.1" />
    <PackageReference Include="Xamarin.GooglePlayServices.MLKit.FaceDetection" Version="117.1.0.5" />
    <PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.9.21.1" />
  </ItemGroup>

Making more test before send you info:

  • Emulator Android 10: No implementation error, both: mono-android and net8 works well
  • Emulator Android 12.1 (tested in two of them Nexus 7 and Pixel 5): with net8 I have implementation error with resources message, with mono-android works well
  • Emulator Android 13:with net8 I have implementation error with resources message, with mono-android works well

Implementation error (the same):
Captura de pantalla 2024-01-09 235241

What can be happening?

Thank you for your support

@jonathanpeppers
Copy link
Member

When you say "mono-android", do you mean Xamarin.Android? Or something older than .NET 8? .NET 7?

I'm not sure if the new @(AndroidLibrary) item group is even supported in Xamarin.Android.

There are some fixes in .NET 8 that could be related:

@rfrailemartinez
Copy link
Author

Good morning @jonathanpeppers
Because this is Xamarin-android github, I am trying to difference both as nugets use, for exameple
Captura de pantalla 2024-01-10 082946
mono-android for me is Xamarin.Android before Net7 and Net8. If there is a better way, please tell me

I think these fixes are not related, because in this moment, Net8 version works well in Android 10 emulator, fails during implementation in Android 12.1 and 13 emulators.

@jonathanpeppers
Copy link
Member

Do you need to support Xamarin.Android? It is end-of-life soon: https://dotnet.microsoft.com/platform/support/policy/xamarin

If .NET 8 is working for you, there is likely some fix there (there are a lot) that is making it work.

@rfrailemartinez
Copy link
Author

Sorry for my English @jonathanpeppers
I need support in .Net8, because it fails during implementation in Android 12.1 and 13 emulators.
XamarinAndroid verion works well, but we need to migrate to net8 because it is end-of-life as you said

@jonathanpeppers
Copy link
Member

What does "it fails during implementation" mean? Does it crash at runtime?

If so, what is the crash, can you share adb logcat output of the crash?

@rfrailemartinez
Copy link
Author

@jonathanpeppers it is not a runtime, it is deployment error
I have installed english language pack and update visual studio and now it is working well in android 12 an 13.
This is great news, but, is there a way to see what I have update?

thank you

@jonathanpeppers
Copy link
Member

So you were probably running into this problem with deployment, if it was a problem with a specific device: #8329

I think this was fixed in recent version of Visual Studio (it was an IDE-side fix).

But it's hard to know without seeing the error message or a .binlog if it was relevant.

Is everything working now as expected? Can we close this one?

@rfrailemartinez
Copy link
Author

Thank you very much, the binlog is the same I sent some days ago., but remember it has +100 aars in the test project.
Now it is working as expected
Thanks

@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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