dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

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

Closed rfrailemartinez closed 11 months ago

rfrailemartinez commented 11 months ago

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:

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

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 34 with Net 8

Did you find any workaround?

No

Relevant log output

No response

drasticactions commented 11 months ago

Is this something specific to MAUI UI projects, or can you replicate that with a .NET Android app without the MAUI UI Framework (dotnet new android)? This seems like something that would be related to xamarin-android tooling, and not related to this project.

ghost commented 11 months ago

Hi @rfrailemartinez. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

rfrailemartinez commented 11 months ago

@drasticactions thank you, moved to xamarin-android https://github.com/xamarin/xamarin-android/issues/8609