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

iOS Binding Library - Cannot find types declared #17541

Closed
PureWeen opened this issue Feb 14, 2023 · 14 comments
Closed

iOS Binding Library - Cannot find types declared #17541

PureWeen opened this issue Feb 14, 2023 · 14 comments
Labels
binding-projects Issue or PR that affects binding projects need-attention An issue requires our attention/response
Milestone

Comments

@PureWeen
Copy link


Issue moved from dotnet/maui#13283


From @orwo1 on Sunday, February 12, 2023 12:35:20 PM

Description

I've tried making an iOS binding library in VS for Mac.
I used Sharpie to create both definitions files, fixed what was wrong in them( NSArray -> T[] ).
The project compiles.
I reference it in MAUI app and MAUI class library with condition:
<ItemGroup Condition="$(TargetFramework.Contains('-ios')) != false "> <ProjectReference Include="..\iOSBinding1\iOSBinding1.csproj" /> </ItemGroup>
I Cannot access any type declared in the binding library, in my app/class library.

The Android Binding Library works fine under Visual Studio for Windows,
Under the reverse condition in the csproj.

Steps to Reproduce

  1. Create Binding Library wrapping a .framework with native reference and Sharpie's output in the:
    ApiDefinition.cs
    StructsAndEnums.cs
  2. Reference the project in a Maui Class Library/Maui App.
  3. Try to use any type declared in the binding library

Link to public reproduction project repository

NA

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15, iOS 15.5, iOS 16.1

Did you find any workaround?

No

Relevant log output

No response

@PureWeen
Copy link
Author


Issue moved from dotnet/maui#13283


From @orwo1 on Sunday, February 12, 2023 12:37:29 PM

More info:
That same .framework wrapped in Xamarin.Formsm iOS binding library, works in a Xamarin.Forms project.
I believe with the same Api and Enums output from Sharpie.

@PureWeen
Copy link
Author


Issue moved from dotnet/maui#13283


From @orwo1 on Sunday, February 12, 2023 1:25:07 PM

Using:
Visual Studio for Mac 17.4.4
XCode 14.2

@PureWeen
Copy link
Author


Issue moved from dotnet/maui#13283

  • Please respond to @msftbot[bot].

From @msftbot[bot] on Monday, February 13, 2023 3:09:43 PM

Hi @orwo1. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

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.

@PureWeen
Copy link
Author


Issue moved from dotnet/maui#13283


From @orwo1 on Tuesday, February 14, 2023 6:51:16 AM

@jsuarezruiz Hi
I can't upload propriety .framework to github, in order to create a repro.
I've just created a solution with a basic MAUI class library,
an ios binding library,
and referenced it in the class library using the condition above.
There's nothing much to it other than that.

@rolfbjarne
Copy link
Member

@orwo1 I believe this to be a duplicate of #10148 - does it work if you build the binding project separately, and then reference the resulting assemby (.dll) from the main project?

@rolfbjarne rolfbjarne added this to the Future milestone Feb 15, 2023
@rolfbjarne rolfbjarne added need-info Waiting for more information before the bug can be investigated binding-projects Issue or PR that affects binding projects labels Feb 15, 2023
@ghost
Copy link

ghost commented Feb 15, 2023

Hi @PureWeen. We have added the "need-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.

@orwo1
Copy link

orwo1 commented Feb 15, 2023

@orwo1 I believe this to be a duplicate of #10148 - does it work if you build the binding project separately, and then reference the resulting assemby (.dll) from the main project?

Hi @rolfbjarne
Haven't tried that, will check this option and get back to you here.

@ghost ghost added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Feb 15, 2023
@rolfbjarne rolfbjarne added need-attention An issue requires our attention/response need-info Waiting for more information before the bug can be investigated and removed need-attention An issue requires our attention/response labels Feb 15, 2023
@ghost
Copy link

ghost commented Feb 16, 2023

Hi @PureWeen. We have added the "need-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.

@orwo1
Copy link

orwo1 commented Feb 16, 2023

Hi @rolfbjarne
Your suggestion seems to work, and by referencing the dll I was able
to access types defined in it.
I guess the next question is whether Microsoft knows of this issue?

@ghost ghost added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Feb 16, 2023
@rolfbjarne
Copy link
Member

I guess the next question is whether Microsoft knows of this issue?

I'm not sure I understand what issue you're talking about?

@rolfbjarne
Copy link
Member

Closing as duplicate of #10148.

@rolfbjarne rolfbjarne closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
@orwo1
Copy link

orwo1 commented Feb 16, 2023

I guess the next question is whether Microsoft knows of this issue?

I'm not sure I understand what issue you're talking about?

The issue of a project reference not working the same way a dll file reference works (or vice versa).
This is not an issue?

@rolfbjarne
Copy link
Member

I guess the next question is whether Microsoft knows of this issue?

I'm not sure I understand what issue you're talking about?

The issue of a project reference not working the same way a dll file reference works (or vice versa). This is not an issue?

Yes, it's filed here: #10148.

@orwo1
Copy link

orwo1 commented Feb 16, 2023

I guess the next question is whether Microsoft knows of this issue?

I'm not sure I understand what issue you're talking about?

The issue of a project reference not working the same way a dll file reference works (or vice versa). This is not an issue?

Yes, it's filed here: #10148.

Oh ok thanks for the help!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
binding-projects Issue or PR that affects binding projects need-attention An issue requires our attention/response
Projects
None yet
Development

No branches or pull requests

3 participants