Forum Xamarin.iOS

dylib as Native Reference in a library project

I remember reporting a similar issue with native libraries in a library project for Android several years ago. The native libraries did not get built into the output apk unless they were added to the startup project. They did not work when added to a library project that was referenced by the startup project. That issue was fixed back then with the <EmbeddedNativeLibrary> tag in the csproj. Native libraries can now be referenced in the library project where they belong, and they will get added to the output apk. This has worked for several years now.

The same issue is now happening on Mac, but with Native References and app bundles. Adding a dylib as a Native Reference in a library project means that dylib is not included in the app bundle. Adding the dylib as a Native Reference in the startup project does include the dylib in the app bundle.

I'm using Visual Studio for Mac.

LibraryProject
  - References
  - Native References
    - libopenal.1.dylib    <-- Native Reference in LibraryProject
  - ...
MyAppProject
  - References
    - LibraryProject       <-- References LibraryProject
  - Native References
  - ...

Does not include libopenal.1.dylib in the app bundle.

LibraryProject
  - References
  - Native References
  - ...
MyAppProject
  - References
    - LibraryProject      <-- References LibraryProject
  - Native References
    - libopenal.1.dylib   <-- Native Reference that should be in LibraryProject
  - ...

Does include libopenal.1.dylib in the app bundle.

Am I just doing this wrong?

Posts

Sign In or Register to comment.