我在Xamarin应用程序中安装了realm,当我尝试使用一个对象(count,write等)时,它给了我一个System.EntryPointNotFoundException.
代码如下:
_realm = Realm.GetInstance();
_realm.Write(() =>
{
var myConfig = _realm.CreateObject<Config>();
myConfig.Email = "";
myConfig.User = "";
});
System.EntryPointNotFoundException: shared_realm_begin_transaction
at at (wrapper managed-to-native) Realms.NativeSharedRealm:begin_transaction (Realms.SharedRealmHandle)
at Realms.Transaction..ctor (Realms.SharedRealmHandle sharedRealmHandle) [0x0000d] in :0
at Realms.Realm.BeginWrite () [0x00000] in :0
at Realms.Realm.Write (System.Action action) [0x00000] in :0
at rasoApp.ConfigViewModel..ctor () [0x00025] in /Users/luis/Projects/rasoApp/rasoApp/viewModels/ConfigViewModel.cs:22
at rasoApp.ConfigPage.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x0000e] in /Users/luis/Projects/rasoApp/rasoApp/views/ConfigPage.xaml.cs:13
at rasoApp.HomePage.btnOpenConfig (System.Object sender, System.EventArgs e) [0x00007] in /Users/luis/Projects/rasoApp/rasoApp/views/HomePage.xaml.cs:18
at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x00020] in :0
at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x0000e] in :0
at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/src/UIKit/UIControl.cs:38
at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/src/UIKit/UIApplication.cs:63
at rasoApp.iOS.Application.Main (System.String[] args) [0x00008] in /Users/luis/Projects/rasoApp/iOS/Main.cs:17
最佳答案 祝贺一个有趣的问题!
我已经看到了类似的错误,但只是在最近的工作中我正在改进代码生成,当我生成错误的IL代码时.我们没有记录以前的问题,也没有任何关于我可以找到的EntryPointNotFoundException消息的讨论.
如果您尝试构建Realm source download中的一个示例,例如QuickJournal是否有效?
如果您可以发送一个完整的项目来演示问题,请发送电子邮件至help@realm.io,这可能是解决问题的最快方法.
更新2016-07-11
看看another SO question让我想到了一些可以尝试的事情:
>这是否会在所有平台上发生?
– 您在Xamarin工作室中启用了完全链接吗?
早先的建议
您的应用是否包含包含该逻辑的PCL?
您是否还将Realm NuGet安装到主应用程序(IOS或Android)项目中?这是必要的一步.主要的Realm库仅包含在NuGet添加到IOS或Android项目中的特定于平台的dll中.