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 #19569

Closed
rfrailemartinez opened this issue Dec 22, 2023 · 3 comments
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@rfrailemartinez
Copy link

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

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

@rfrailemartinez rfrailemartinez added the t/bug Something isn't working label Dec 22, 2023
@drasticactions
Copy link
Contributor

drasticactions commented Dec 23, 2023

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.

@drasticactions drasticactions added the s/needs-info Issue needs more info from the author label Dec 23, 2023
@ghost
Copy link

ghost commented Dec 23, 2023

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
Copy link
Author

@drasticactions thank you, moved to xamarin-android
dotnet/android#8609

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Dec 23, 2023
@drasticactions drasticactions closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2024
@samhouts samhouts added platform/android 🤖 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants