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

Issues with Template #69

Open
guipalazzo opened this issue Jan 7, 2025 · 3 comments
Open

Issues with Template #69

guipalazzo opened this issue Jan 7, 2025 · 3 comments

Comments

@guipalazzo
Copy link

Description

The template, as is, does not seem to be working. The using directives are not being recognized, apparently due to the declaration of Metadata.xml.

I tried many different approaches to fix this (mostly by trying to add the generated *. aar file somehow to the project, for instance, as an AndroidLibrary or as an EmbeddedReferenceJar), but I'm getting to the conclusion that the original intention was to have something behind the scenes that would make the conversion specified in the Metadata.xml implementation work.

As per the content generated about the template, I was expecting that a simple build in Android Studio would be enough to make it happen. Before trying to fix this as I mentioned above, I was expecting that a simple build of the native Android project, followed by the build of the .Net Maui project, would be enough, as per the high level discussion on this between @rachelkang and @jamesmontemagno.

Steps to Reproduce

  1. Clone the repository
  2. Open the template solution as is
  3. Build the android native project
  4. Build the .Net Maui
  5. See that the Android using directives are not working;

Link to public reproduction project repository

No response

Environment

  • OS:
  • .NET MAUI:
  • Target platforms:
@rachelkang rachelkang added needs info Requires more information from issue reporter needs reproduction labels Jan 13, 2025
@rachelkang
Copy link
Collaborator

Hi @guipalazzo - Could you please elaborate on how the using directives are not being recognized? Are you running into specific build errors? If so, could you please share a binlog?

@guipalazzo
Copy link
Author

Hello @rachelkang,

When you open the template on your end, does it work out of the box? When I do so on my end, I see a 'Cannot resolve symbol 'NewBindingMaciOS' related to the using directives of 'MauiPage.xaml.cs'. I was expecting it though, as I'm using a PC.

#if IOS || MACCATALYST using NewBinding = NewBindingMaciOS.DotnetNewBinding; #elif ANDROID using NewBinding = NewBindingAndroid.DotnetNewBinding; #elif (NETSTANDARD || !PLATFORM) || (NET6_0_OR_GREATER && !IOS && !ANDROID) using NewBinding = System.Object; #endif

However, even if I remove the iOS, MacOS and PC related directives, as follows, I'm still not able to use 'NewBinding'.

#if ANDROID using NewBinding = NewBindingAndroid.DotnetNewBinding; #endif

So, the question would be, what are the necessary steps in order to make this work? I tried to compile the native project in Android Studio, but nothing happens, so I'm not sure how to make this slim bindings work at all.

@dotnet-policy-service dotnet-policy-service bot removed needs info Requires more information from issue reporter needs reproduction labels Jan 13, 2025
@guipalazzo
Copy link
Author

Hello @rachelkang,

When you open the template on your end, does it work out of the box? When I do so on my end, I see a 'Cannot resolve symbol 'NewBindingMaciOS' related to the using directives of 'MauiPage.xaml.cs'. I was expecting it though, as I'm using a PC.

#if IOS || MACCATALYST using NewBinding = NewBindingMaciOS.DotnetNewBinding; #elif ANDROID using NewBinding = NewBindingAndroid.DotnetNewBinding; #elif (NETSTANDARD || !PLATFORM) || (NET6_0_OR_GREATER && !IOS && !ANDROID) using NewBinding = System.Object; #endif

However, even if I remove the iOS, MacOS and PC related directives, as follows, I'm still not able to use 'NewBinding'.

#if ANDROID using NewBinding = NewBindingAndroid.DotnetNewBinding; #endif

So, the question would be, what are the necessary steps in order to make this work? I tried to compile the native project in Android Studio, but nothing happens, so I'm not sure how to make this slim bindings work at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants