GithubHelp home page GithubHelp logo

Comments (3)

rolfbjarne avatar rolfbjarne commented on June 2, 2024

The problem is that your binding project says these two fields exist in the library:

[Static]
partial interface Constants
{
    // extern double TURecipientBarVersionNumber;
    [Field("TURecipientBarVersionNumber", "__Internal")]
    double TURecipientBarVersionNumber { get; }

    // extern const unsigned char [] TURecipientBarVersionString;
    [Field("TURecipientBarVersionString", "__Internal")]
    NSString TURecipientBarVersionString { get; }
}

but they don't:

$ nm RecipientBarBinding/Lib/libServiceRecipientBar.a | grep TURecipientBarVersionNumber
[no output]

$ nm RecipientBarBinding/Lib/libServiceRecipientBar.a | grep TURecipientBarVersionString
[no output]

it looks like they're in the framework though:

$ nm RecipientBarBinding/Lib/TURecipientBar.framework/TURecipientBar | grep TURecipientBarVersionString
0000000000010190 S _TURecipientBarVersionString

$ nm RecipientBarBinding/Lib/TURecipientBar.framework/TURecipientBar | grep TURecipientBarVersionNumber
00000000000101c8 S _TURecipientBarVersionNumber

So maybe try adding the framework instead of the static library to the binding project?

Also note that we recommend using an .xcframework instead of either a framework or a static library, because an .xcframework can contain native bits for all architectures (neither a framework nor a static library can contain arm64 bits for both the simulator and device, while an xcframework can).

from xamarin-macios.

rameshkec85 avatar rameshkec85 commented on June 2, 2024

Thanks for the reply @rolfbjarne But the same library works for net7.0

from xamarin-macios.

rolfbjarne avatar rolfbjarne commented on June 2, 2024

I see, this is the consequence of a bug fix we did in .NET 8.

In .NET 7 the library compiles, but the properties in question (Constants.TURecipientBarVersionNumber and Constants.TURecipientBarVersionString) do not. If you try to call them, you'll get 0 or null back. This is because the native properties have been linked away by the native linker.

The fix we did was to ask the native linker to keep the native property for any such managed binding - with the downside that if the native property doesn't actually exist, you'll now get a build error.

The fix is to make sure the native library has everything you're binding in your binding project (in your case you could do that by removing the bindings for these properties).

from xamarin-macios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.