我已经用Xamarin表单实现了Linphone。它在iOS中运行良好,但在Android中崩溃。它显示了这个异常
System.DllNotFoundException
linphone.framework/linphone assembly:<unknown assembly> type:<unknown type> member:(null)
它显示以下代码之后的异常
CoreListener listener = Factory.Instance.CreateCoreListener();
我需要下载什么特定的Android SDK才能让Linphone工作吗?我不知道怎么解决这个问题。有什么建议吗?
主要的尝试是清除/重建解决方案,然后尝试卸载并重新安装库,因为这是一个dllNotFound异常,如果其他异常不起作用,你可以尝试从这里找到丢失的DLL(但对于这个,你必须找出丢失的DLL文件(。
我知道这些都是简单的事情,但也许你当时没有考虑
我在其他第三方库中也遇到过类似的问题,我发现链接器导致了这个问题。你试过关闭链接器吗?
以下是如何在VS 2022上做到这一点:
右键单击您的Xamarin.Android项目>属性>Android选项>链接器属性>将链接设置为所需配置的None
查看此页面了解有关链接的更多信息
我通过对代码进行一个小的更改来解决这个问题。
#if WINDOWS_UWP
public const string BELLE_SIP_LIB_NAME = "bellesip";
public const string BCTOOLBOX_LIB_NAME = "bctoolbox";
#else
public const string BELLE_SIP_LIB_NAME = "linphone";
public const string BCTOOLBOX_LIB_NAME = "linphone";
#endif
我把public const string BELLE_SIP_LIB_NAME = "linphone.framework/linphone";
改成了public const string BELLE_SIP_LIB_NAME = "linphone";
。我认为linphone.framework.中缺少一些库