xamarin.ios/monotouch出现问题,mvvmcross和链接 [英] Trouble with xamarin.ios/monotouch , mvvmcross and linking

查看:59
本文介绍了xamarin.ios/monotouch出现问题,mvvmcross和链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个令人烦恼的问题,如果我仅在xamarin Studio中使用链接SDK程序集,我会收到一个异常,如果我使用不链接,则不会发生该异常.我已将问题定位为我正在使用的第三方dll的一部分(用于视频流服务的api).我相信链接程序会剥离此dll使用的某些方法. 是否可以跳过某些库的链接,并且可以从此堆栈跟踪中查看哪个.

I have an irritating issue, if I use Link SDK Assemblies only in xamarin studio I get an exception, if I use dont link the exception is not happening. I have located the issue to be part of an third party dll i am using(api for a video streaming service). I believe the linker is stripping some of the methods used by this dll. Is it possible skip link of some libraries and is it possible to see which from this stacktrace.

    2013-05-08 14:40:54.688 AppsfabrikkenTouch[5662:907] mvx: Diagnostic:  18,23 Exception masked NullReferenceException: Object reference not set to an instance of an object
      at System.Delegate.Combine (System.Delegate a, System.Delegate b) [0x00018] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Delegate.cs:473 
  at Cirrious.MvvmCross.ViewModels.MvxNotifyPropertyChanged.add_PropertyChanged (System.ComponentModel.PropertyChangedEventHandler value) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Bindings.Source.MvxBasePropertyInfoSourceBinding..ctor (System.Object source, System.String propertyName) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Bindings.Source.MvxPropertyInfoSourceBinding..ctor (System.Object source, System.String propertyName) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Bindings.Source.Construction.MvxSourceBindingFactory.CreateBinding (System.Object source, IEnumerable`1 childPropertyNames) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Bindings.Source.Construction.MvxSourceBindingFactory.CreateBinding (System.Object source, System.String combinedPropertyName) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Binders.MvxFullBinding.CreateSourceBinding (System.Object source) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Binders.MvxFullBinding..ctor (Cirrious.MvvmCross.Binding.Interfaces.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder.BindSingle (Cirrious.MvvmCross.Binding.Interfaces.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder+<>c__DisplayClass1.<Bind>b__0 (Cirrious.MvvmCross.Binding.Interfaces.MvxBindingDescription description) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator1D`2[Cirrious.MvvmCross.Binding.Interfaces.MvxBindingDescription,Cirrious.MvvmCross.Binding.Interfaces.IMvxUpdateableBinding].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Interfaces.IMvxUpdateableBinding].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Interfaces.IMvxUpdateableBinding].AddRange (IEnumerable`1 collection) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Touch.ExtensionMethods.MvxBindingTouchExtensions.AddBindings (IMvxBindingTouchView view, IEnumerable`1 bindings) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Touch.ExtensionMethods.MvxBindingTouchExtensions.AddBindings (IMvxBindingTouchView view, System.Object source, System.Object target, System.String bindingText) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Touch.ExtensionMethods.MvxBindingTouchExtensions.AddBindings (IMvxBindingTouchView view, System.Object source, IDictionary`2 bindingMap) [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Touch.ExtensionMethods.MvxBindingTouchExtensions.AddBindings (IMvxBindingTouchView view, IDictionary`2 bindingMap) [0x00000] in <filename unknown>:0 
  at CmsApp.Touch.TabTextView.ViewDidLoad () [0x00074] in /Volumes/2end HDD/Dropbox/AppProjects/Appsfabrikken/CmsApp.Touch/Views/UmbracoViews/TabTextView.cs:45 
  at MonoTouch.UIKit.UINavigationController.PushViewController (MonoTouch.UIKit.UIViewController viewController, Boolean animated) [0x00019] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UINavigationController.g.cs:178 
  at CmsApp.Touch.AppPhonePresenter.Show (IMvxTouchView view) [0x0007b] in /Volumes/2end HDD/Dropbox/AppProjects/Appsfabrikken/CmsApp.Touch/AppPhonePresenter.cs:62 
  at Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.Show (Cirrious.MvvmCross.Views.MvxShowViewModelRequest request) [0x00000] in <filename unknown>:0 
  at CmsApp.Touch.AppPhonePresenter.Show (Cirrious.MvvmCross.Views.MvxShowViewModelRequest request) [0x00000] in /Volumes/2end HDD/Dropbox/AppProjects/Appsfabrikken/CmsApp.Touch/AppPhonePresenter.cs:37 
  at Cirrious.MvvmCross.Touch.Views.MvxTouchViewDispatcher+<>c__DisplayClass1.<RequestNavigate>b__0 () [0x00000] in <filename unknown>:0 
  at Cirrious.MvvmCross.Touch.Views.MvxTouchUIThreadDispatcher+<>c__DisplayClass1.<InvokeOrBeginInvoke>b__0 () [0x00000] in <filename unknown>:0 

感谢您的帮助.

更新: 根据stuart的建议(感谢stuart),我添加了一个LinkerPleaseInclude文件,其中包含以下内容:但是它仍然会出现异常.

UPDATE: As suggested by stuart (thanks stuart) I have added an LinkerPleaseInclude file with the following: But it still get an exception.

class LinkerIncludePlease
    {
        private void DelegateCombine(Delegate a, Delegate b)
        {
            var d = Delegate.Combine(a,b);
        }

        private void DelegateCombine(params Delegate[] delegates)
        {
            var d = Delegate.Combine(delegates);
        }

        private void DelegateCombine()
        {
            var d = Delegate.Combine();
        }

    }

我认为它必须与stacktrace有关

My thought was that it had to be something related to the stacktrace

Exception masked NullReferenceException: Object reference not set to an instance of an object
          at System.Delegate.Combine (System.Delegate a, System.Delegate b) [0x00018] 

但是似乎并不能解决问题-是否有任何指针可以找到被剥夺的内容?

But it seems not to do the trick - any pointers to find what is stripped out?

推荐答案

当链接器执行其工作时,我找不到丢失的内容.

I was not able to find what was missing, when the linker was doing its job.

但是我发现在一次绑定期间,视频api正在进行一次同步restsharp调用,这使绑定等到完成为止,这似乎引起了问题.如果我更改了工作流程并启动了异步restsharp调用,然后在完成后启动了绑定,那么所有操作都非常吸引人.

However I found that during one binding, the video api was doing a synchrony restsharp call which made the binding wait till done and this seemed to cause the problem. If I changed the workflow and started a asynchrony restsharp call, which then starts the binding when done, it all worked as a charm.

非常感谢您的帮助.

这篇关于xamarin.ios/monotouch出现问题,mvvmcross和链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆