⚠ The NuGet package for Xamarin development with .NET can only be built from an Apple macOS operating system.
To build a NuGet package for Android & iOS development with Xamarin, you will first need to build (or download) the SDK for both Android and iOS, and make sure you have the C# wrapper (which can be generated by either of these builds).
mkdir build-nuget
cd build-nuget
cmake .. -DLINPHONESDK_CSHARP_WRAPPER_PATH="..." -DLINPHONESDK_ANDROID_AAR_PATH="..." -DLINPHONESDK_IOS_XCFRAMEWORKS_PATH="..." -DLINPHONESDK_VERSION="..."
cmake --build .
If you run cmake from the root of the linphone-sdk
repository, then you will need to pass -DLINPHONESDK_PACKAGER="Nuget"
as well.
You can take a look at the job-xamarin-package
CI job for an example invocation
This must be run on a macOS machine, but you don't have to pass any extra arguments: CMake will detect your system and configure accordingly.
⚠ The NuGet package for Windows development with .NET can only be built from a Microsoft Windows operating system.
You can package 3 kinds of binaries : win32, uwp and win32 with Windows Store Compatibility.
- win32: this is the win32 version of linphone-sdk without any restrictions. The framework is 'win'.
- uwp : this is a uwp x64 version of linphone-sdk. You will not be able to use OpenH264 and Lime X3DH. The framework is 'uap10.0'.
- win32 Windows Store : this is the win32 version of linphone-sdk with the Windows Store Compatibility enabled for Windows Bridge. The framework is 'netcore'.
In an another build folder (like build-nuget), set these options :
- (Needed)
-DLINPHONESDK_PACKAGER=Nuget
- (Optional)
-DLINPHONESDK_DESKTOP_ZIP_PATH=<path of the zip file containing the Desktop binaries>
(eg. C:/projects/desktop-uwp/linphone-sdk/buildx86/linphone-sdk) - (Optional)
-DLINPHONESDK_UWP_ZIP_PATH=<path of the zip file containing the UWP binaries>
(eg. C:/projects/desktop-uwp/linphone-sdk/builduwp/linphone-sdk) - (Optional)
-DLINPHONESDK_WINDOWSSTORE_ZIP_PATH=<path of the zip file containing the Desktop binaries with Store compatibility enabled>
(eg. C:/projects/desktop-uwp/linphone-sdk/buildx86_store/linphone-sdk)
Build the Package:
cmake ..
cmake --build . --target ALL_BUILD --config=RelWithDebInfo
The nuget package will be in linphone-sdk/packages
The generated package can keep the same file name between generations on the same git version.
Visual studio keeps a cache and you need to delete its internal folder to force a new packaging.
The folder can be found in your system path at <User>/.nuget/packages/linphonesdk
Intended for maintainers working on packaging the LinphoneSDK for .NET
System.DllNotFoundException
Message=linphone assembly:<unknown assembly> type:<unknown type> member:(null)
You are probably missing the native library for your architecture.
E.g. if you are building for an Android emulator, make sure the .aar
includes the x86_64
architecture. (You can use ANDROID_ARCHS=arm64,armv7,x86_64,x86
in the CI pipeline)
Beware the nuget
cache.
If you are manually tinkering with a local build, you probably re-exported the package with the same version. In that case, nuget will reuse the cached version of the package. Make sure you either clear the cache or use a different version name when exporting the package. (You can use the -Suffix
option of the nuget
cli for that.)