Skip to content

[native] Question: Only use runtimes/{rid}/native without NativeReference?  #14622

@KiruyaMomochi

Description

@KiruyaMomochi

It's a question and I find it's hard to fill that issue template...

I'm currently building a native package for MacCatalyst and iOS.

For .NET 6 desktop platform like Windows/macOS desktop, I know putting native library files in runtimes/{rid}/native just work. However, Xamarin.iOS docs tells me that I must use PackNativeLibrary item to add them, so I add a .target file to my packge and it works.

I also found that SkiaSharp.NativeAssets.MacCatalyst doesn't use PackNativeLibrary, it only put files in runtimes. After testing this works well for me too.

Now is what confusing me

Another package SkiaSharp.NativeAssets.iOS, doesn't like the one for catalyst, includes .targets files for net6.0-ios13.6 and xamarinios1.0. But it also works after removing these .targets files. (Tested on simulator. I don't have any real iOS device, so I don't know if the behavior is the same on a real phone.)

The question

By checking #11667, I believe just put these native files in runtimes/{rid}/native is enough, and no NativeReference is required. Is that correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportThe issue is related to support

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions