Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I looked at some of the source, and it seems to me that the call to SetResult can throw an exception. That exception doesn't appear to be caught internally.
My line of code is "someView.TranslateTo(0.0, 0.0, 50);"
System.InvalidOperationExceptionAn attempt was made to transition a task to a final state when it had already completed.
at System.Threading.Tasks.TaskCompletionSource`1[TResult].SetResult (System.Threading.Tasks.TResult result) [0x0000c] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs:322
at Xamarin.Forms.ViewExtensions+<>c__DisplayClass0_0.<TranslateTo>b__2 (Double f, Boolean a) [0x00000] in <filename unknown>:0
at Xamarin.Forms.AnimationExtensions+<>c__DisplayClass10_0`1[T].<Animate>b__1 (Double f, Boolean b) [0x00012] in <filename unknown>:0
at Xamarin.Forms.AnimationExtensions.AbortAnimation (Xamarin.Forms.AnimatableKey key) [0x0005c] in <filename unknown>:0
at Xamarin.Forms.AnimationExtensions.Animate[T] (IAnimatable self, System.String name, System.Func`2 transform, System.Action`1 callback, UInt32 rate, UInt32 length, Xamarin.Forms.Easing easing, System.Action`2 finished, System.Func`1 repeat) [0x0005d] in <filename unknown>:0
at Xamarin.Forms.AnimationExtensions.Animate (IAnimatable self, System.String name, System.Action`1 callback, UInt32 rate, UInt32 length, Xamarin.Forms.Easing easing, System.Action`2 finished, System.Func`1 repeat) [0x00000] in <filename unknown>:0
at Xamarin.Forms.AnimationExtensions.Animate (IAnimatable self, System.String name, Xamarin.Forms.Animation animation, UInt32 rate, UInt32 length, Xamarin.Forms.Easing easing, System.Action`2 finished, System.Func`1 repeat) [0x00008] in <filename unknown>:0
at Xamarin.Forms.Animation.Commit (IAnimatable owner, System.String name, UInt32 rate, UInt32 length, Xamarin.Forms.Easing easing, System.Action`2 finished, System.Func`1 repeat) [0x00000] in <filename unknown>:0
at Xamarin.Forms.ViewExtensions.TranslateTo (Xamarin.Forms.VisualElement view, Double x, Double y, UInt32 length, Xamarin.Forms.Easing easing) [0x000a5] in <filename unknown>:0
If you could possibly provide a sample reproduction project running on the latest stable showing a scenario where this would occur, it would be appreciated in helping to investigate the issue.
Can't you just look at the code and see the exception that it isn't handling?
Paul is just helping us make sure we have all the info we need to address a bug. I can see where the crash is obviously happening, the bigger question is what is happening to trigger Finished to be called twice...
It looks like AbortAnimation is being called, no chance you are calling TranslateTo a lot or maybe from a thread?
Hey Jason, what you mean by calling it a lot?
Is there a limit?
We need to ship our app ASAP but since update to 126.96.36.19929 all animations started to behave totally crazy.
I got the same bug as above, and for repro just add a label and animate it, and move to next page.
Also, I'm getting a lot of "this must be run for the UI thread checks", on a sequence like this, that DOES start on the UI thread:
private async Task ExecuteStoryboardAsync()
await LogoImage.ScaleTo(0.25f, length: 500, easing: Easing.CubicOut);
await LogoImage.ScaleTo(25, length: 500, easing: Easing.CubicIn);
Submitted too soon, sorry...
The failed check happens on the second ScaleTo, looks like the continuation is not been called on the UI Thread!
There is no limit, I am just trying to figure out how to trigger the issue.
Does wrapping the call into a BeginInvokeOnMainThread fix it? We dont do the martial back to the UIThread, that is done by the await mechanism
Can't you just look at the code and see that it throws an exception which is not handled?
We've run into this as well. It's hard to reproduce with any sort of consistency, but seems to happen on older devices when you have a button with an animation to shrink it on tap, and you double or triple tap it cause you are impatient at the slow device :-). The code below is the relevant part from the tapped event.
isAnimating = true;
myButton.AnchorX = 0.5;
myButton.AnchorY = 0.5;
await myButton.ScaleTo(0.50, 75, Easing.SinOut);
await myButton.ScaleTo(1, (uint) 75, Easing.SinIn);
isAnimating = false;
We added the isAnimating check as an attempt to stop it from trying to run the animation if it was already in progress. Originally the scale to's were run using Device.BeginInvokeOnMainThread, but with the latest 2.2 or 2.3 Forms update where animations were all changed to run on main thread we had to remove that.
here's a log from a crash:
I am closing this as a complete, working reproduction project of the described issue has not been provided to date. If someone is able to do so, please feel free to reopen this and attach said project and we'll look into it.
Must be same problem. Was using ScaleTo.
Crash when opening drawer menu on iOS, while having animations running on main ui thread. Happens instantly of after a number of clicks, totally random, but 100% to happen.
The project was crated from blank app, added 3 files : root, master and detail, nothing unusual, nothing special.
Just lauch app, no matter simulator or real device, no matter release or debug.
Start clicking on the left upper corner opening and closing menu.
This menu animation will suddenly (from instant to up to like 5-7 minutes) conflict with your image animation that is run on main UI thread.
Just don't stop clicking..
Read other file in same dir for crash log, that ends by
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.