Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PropertyBindingMixins.Bind crashes #2170

Open
setallunder opened this issue Sep 18, 2019 · 12 comments · May be fixed by #2221
Labels
bug

Comments

@setallunder
Copy link

@setallunder setallunder commented Sep 18, 2019

Describe the bug
ReactiveUI.PropertyBindingMixins.Bind throws android.runtime.JavaProxyThrowable: System.Reflection.TargetParameterCountException: Parameter count mismatch.

Steps To Reproduce

  1. Create new Xamarin.Android project;
  2. Add layout with TextView;
  3. Invoke ReactiveUI.PropertyBindingMixins.Bind inside activity to bind TextView.Text with ViewModel for example:
this.Bind(
                ViewModel,
                x => x.ImportantText,
                x => x.SuperTextView.Text);
  1. Launch app on device;
  2. Observe crash.

Expected behavior
No crash

Stacktrace

09-18 13:00:36.914 E/AndroidRuntime(12346): FATAL EXCEPTION: main
09-18 13:00:36.914 E/AndroidRuntime(12346): Process: ReaciveUITest.ReaciveUITest, PID: 12346
09-18 13:00:36.914 E/AndroidRuntime(12346): android.runtime.JavaProxyThrowable: System.Reflection.TargetParameterCountException: Parameter count mismatch.
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) [0x000ee] in <ff07eae8184a40a08e79049bbcb31a0e>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) [0x00000] in <ff07eae8184a40a08e79049bbcb31a0e>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.ReflectionUtils.CreateDelegate[TDelegate] (System.Object o, System.Reflection.MethodInfo method) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.FromEvent`2[TDelegate,TEventArgs].GetHandler (System.Action`1[T] onNext) [0x00025] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.EventProducer`2+Session[TDelegate,TArgs].Initialize () [0x00023] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.EventProducer`2+Session[TDelegate,TArgs].Connect (System.IObserver`1[T] observer) [0x00021] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346): --- End of stack trace from previous location where exception was thrown ---
09-18 13:00:36.914 E/AndroidRuntime(12346): 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow (System.Exception exception) [0x00006] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.ExceptionHelpers.Throw (System.Exception exception) [0x0000a] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Stubs+<>c.<.cctor>b__2_1 (System.Exception ex) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.AnonymousSafeObserver`1[T].OnError (System.Exception error) [0x00010] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Subjects.Subject`1[T].OnError (System.Exception error) [0x00065] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Merge`1+Observables+_+InnerObserver[TSource].OnError (System.Exception error) [0x00016] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.914 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1+_+InnerObserver[TSource].OnError (System.Exception error) [0x0002f] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].OnError (System.Exception error) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.EventProducer`2+Session[TDelegate,TArgs].Connect (System.IObserver`1[T] observer) [0x0003e] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.EventProducer`2[TDelegate,TArgs].Run (System.IObserver`1[T] observer) [0x00027] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.BasicProducer`1[TSource].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00052] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.915 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.TailRecursiveSink`1[TSource].Drain () [0x00120] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.TailRecursiveSink`1[TSource].Run (System.Collections.Generic.IEnumerable`1[T] sources) [0x00018] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Concat`1[TSource].Run (System.Reactive.Linq.ObservableImpl.Concat`1+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1+_[TSource].OnNext (System.IObservable`1[T] value) [0x00052] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult].OnNext (TSource value) [0x00021] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1+_+InnerObserver[TSource].OnNext (TSource value) [0x00029] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.IdentitySink`1[T].OnNext (T value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_[TSource].LoopRec (System.Reactive.Concurrency.IScheduler scheduler) [0x00085] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_+<>c[TSource].<Run>b__3_0 (System.Reactive.Concurrency.IScheduler innerScheduler, System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_[TSource] this) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Concurrency.ImmediateScheduler.Schedule[TState] (TState state, System.Func`3[T1,T2,TResult] action) [0x00014] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_[TSource].Run (System.Collections.Generic.IEnumerable`1[T] source, System.Reactive.Concurrency.IScheduler scheduler) [0x00018] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1[TSource].Run (System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.TailRecursiveSink`1[TSource].Drain () [0x00120] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.TailRecursiveSink`1[TSource].Run (System.Collections.Generic.IEnumerable`1[T] sources) [0x00018] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Concat`1[TSource].Run (System.Reactive.Linq.ObservableImpl.Concat`1+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.917 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1+_[TSource].OnNext (System.IObservable`1[T] value) [0x00052] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult].OnNext (TSource value) [0x00021] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ReturnImmediate`1[TSource].Run (System.IObserver`1[T] observer) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.BasicProducer`1[TSource].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00052] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1[TSource].Run (System.Reactive.Linq.ObservableImpl.Switch`1+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Switch`1[TSource].Run (System.Reactive.Linq.ObservableImpl.Switch`1+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.918 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Where`1+Predicate[TSource].Run (System.Reactive.Linq.ObservableImpl.Where`1+Predicate+_[TSource] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.DistinctUntilChanged`2[TSource,TKey].Run (System.Reactive.Linq.ObservableImpl.DistinctUntilChanged`2+_[TSource,TKey] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Sink`2[TSource,TTarget].Run (System.IObservable`1[T] source) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Select`2+Selector[TSource,TResult].Run (System.Reactive.Linq.ObservableImpl.Select`2+Selector+_[TSource,TResult] sink) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Producer`2[TTarget,TSink].SubscribeRaw (System.IObserver`1[T] observer, System.Boolean enableSafeguard) [0x00060] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.ObservableExtensions.SubscribeSafe[T] (System.IObservable`1[T] source, System.IObserver`1[T] observer) [0x00036] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.Merge`1+Observables+_[TSource].OnNext (System.IObservable`1[T] value) [0x00013] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Sink`1[TTarget].ForwardOnNext (TTarget value) [0x00000] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.919 E/AndroidRuntime(12346):   at System.Reactive.Linq.ObservableImpl.ToObservableRecursive`1+_[TSource].LoopRec (System.Reactive.Concurrency.IScheduler scheduler) [0x00085] in <f9e209095f5a4628a0b7a00d8a83c3b9>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at ReactiveUI.PropertyBinderImplementation.BindImpl[TViewModel,TView,TVMProp,TVProp,TDontCare] (TViewModel viewModel, TView view, System.Linq.Expressions.Expression`1[TDelegate] vmProperty, System.Linq.Expressions.Expression`1[TDelegate] viewProperty, System.IObservable`1[T] signalViewUpdate, ReactiveUI.PropertyBinderImplementation+OutFunc`2[T1,T2] vmToViewConverter, ReactiveUI.PropertyBinderImplementation+OutFunc`2[T1,T2] viewToVmConverter) [0x001d9] in <c85e2deedba740d5bf58b3f29bb2d97a>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at ReactiveUI.PropertyBinderImplementation.Bind[TViewModel,TView,TVMProp,TVProp,TDontCare] (TViewModel viewModel, TView view, System.Linq.Expressions.Expression`1[TDelegate] vmProperty, System.Linq.Expressions.Expression`1[TDelegate] viewProperty, System.IObservable`1[T] signalViewUpdate, System.Object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride) [0x0008c] in <c85e2deedba740d5bf58b3f29bb2d97a>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at ReactiveUI.PropertyBindingMixins.Bind[TViewModel,TView,TVMProp,TVProp] (TView view, TViewModel viewModel, System.Linq.Expressions.Expression`1[TDelegate] vmProperty, System.Linq.Expressions.Expression`1[TDelegate] viewProperty, System.Object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride) [0x00000] in <c85e2deedba740d5bf58b3f29bb2d97a>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at ReaciveUITest.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x000b6] in <97283fa6d65c4572be600e1b45bc88f2>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <b62c3fba3fe848f3bb323dbe33464223>:0 
09-18 13:00:36.922 E/AndroidRuntime(12346):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.6(intptr,intptr,intptr)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at md5ac7f87ef6c593a0c21ac7e6bba13fd95.MainActivity.n_onCreate(Native Method)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at md5ac7f87ef6c593a0c21ac7e6bba13fd95.MainActivity.onCreate(MainActivity.java:29)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.Activity.performCreate(Activity.java:7088)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.Activity.performCreate(Activity.java:7079)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.os.Handler.dispatchMessage(Handler.java:106)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.os.Looper.loop(Looper.java:176)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at android.app.ActivityThread.main(ActivityThread.java:6651)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at java.lang.reflect.Method.invoke(Native Method)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
09-18 13:00:36.922 E/AndroidRuntime(12346): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

Environment

  • OS: Android
  • Version 8.1.0
  • Device: Xiaomi Redmi 5 Plus
  • ReactiveUI Version: 10.1.7
@setallunder setallunder added the bug label Sep 18, 2019
@open-collective-bot

This comment has been minimized.

Copy link

@open-collective-bot open-collective-bot bot commented Sep 18, 2019

Hey @setallunder 👋,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing 😄

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!
@bfmyr4

This comment has been minimized.

Copy link

@bfmyr4 bfmyr4 commented Oct 9, 2019

I'm also experiencing this. Android 9, Samsung SM-G892A. Same stack trace.

@ajhuntsman

This comment has been minimized.

Copy link

@ajhuntsman ajhuntsman commented Oct 16, 2019

I just started experiencing this after upgrading from ReactiveUI 9.16.6 to 10.5.1.

@glennawatson

This comment has been minimized.

Copy link
Contributor

@glennawatson glennawatson commented Oct 16, 2019

Going to look into this on the weekend unless someone beats me to it. If someone else gets a pr in the mean time happy to take it.

@ajhuntsman

This comment has been minimized.

Copy link

@ajhuntsman ajhuntsman commented Oct 16, 2019

Thanks @glennawatson!

FWIW, there's no runtime problem in our Xamarin.iOS or Xamarin.Forms apps, and the Xamarin.Forms app is targeted only for Android.

It seems to be a problem unique to the Xamarin.Android runtime.

Here are some truncated logs:

Bind_Logs.log

@ajhuntsman

This comment has been minimized.

Copy link

@ajhuntsman ajhuntsman commented Oct 17, 2019

So far, this only seems to happen when binding to a TextView. And if we use a OneWayBind (from ViewModel to View) the crash does not happen. So it seems that the problem originates from reacting to Android TextView changes.

I don't know anything about the ReactiveUI code base, so take this diagnosis with a grain of salt...

The very bottom of PropertyBinderImplementation.BindImpl had a recent change, where the ReactiveBinding constructor parameter changed from:

Tuple<object, bool>
to
(object view, bool isViewModel)

And the logs seem to indicate that the crash is originating from within the Subscribe block, when Reflection.TrySetValueToPropertyChain is being invoked.

Could it be that the tuple declaration is in some way contributing to the runtime reflection crash?

@RLittlesII

This comment has been minimized.

Copy link
Contributor

@RLittlesII RLittlesII commented Oct 17, 2019

@ajhuntsman We converted from Tuples to Value Tuples because of performance. It's odd that the java runtime would have an issue with it.

@RLittlesII

This comment has been minimized.

Copy link
Contributor

@RLittlesII RLittlesII commented Oct 18, 2019

So I looked into this a little more. Seems that the RefCount() is whats blowing up. I will follow up with @glennawatson to see what we can do to resolve this.

IObservable<(object view, bool isViewModel)> changes = changeWithValues.Where(value => value != null).Select(value => (value.Item1, value.Item2)).Publish().RefCount();

@RLittlesII RLittlesII linked a pull request that will close this issue Oct 18, 2019
0 of 2 tasks complete
@glennawatson

This comment has been minimized.

Copy link
Contributor

@glennawatson glennawatson commented Oct 21, 2019

We tracked down the bug and the location (actually to do with some changes with the Reflection.cs file), so hopefully can get a patch out in the next few days.

@ryanholden8

This comment has been minimized.

Copy link

@ryanholden8 ryanholden8 commented Oct 21, 2019

Just to add more info to this issue: Looks like this exception also happens when binding to Android.Widget.Switch and not just TextViews. Probably any two-way binding is where the crash occurs, I would guess.

@arda-a

This comment has been minimized.

Copy link

@arda-a arda-a commented Nov 16, 2019

Any update or a quick workaround for this ?
Recently updated to the latest version and it seems to be happening on all two way bindings in Xamarin.Android platform.

@RLittlesII

This comment has been minimized.

Copy link
Contributor

@RLittlesII RLittlesII commented Nov 19, 2019

Update

It seems there is something about the reflection used to bind the properties that is causing this issue.

We have a WIP pull request where @glennawatson and I have been doing various fixes trying to address this issue. We rolled back the v10 change and that did not seem to fix the problem, which we found odd.

@arda-a A work around would be to just assign the values in the Subscribe() function on WhenAnyValue of the View Model property. If you are using ReactiveUI.Events you can subscribe to the event for the text box change as an alternative.

@ajhuntsman That was the correct place, it seems the reflection is more the culprit as I did a bit of changing around the ValueTuple with no difference. Still have not found the root of this problem though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.