Bug 23079 - Occasionally, ScaleTo fails with exception on Android
Summary: Occasionally, ScaleTo fails with exception on Android
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-17 00:47 UTC by Prashant Cholachagudda
Modified: 2015-07-17 07:57 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description Prashant Cholachagudda 2014-09-17 00:47:42 UTC

    
Comment 1 Prashant Cholachagudda 2014-09-17 00:53:18 UTC
Occasionally, ScaleTo fails with exception on Android (once in 50 to 80 times)

Version:  Xamarin Forms 1.2.3.6249-pre2
Stack Trace: https://gist.github.com/prashantvc/2b311bb5c621c29521e9
Test case: https://gist.github.com/prashantvc/aea65e40ebb77330d1db
Comment 2 Sadik Ali 2014-09-17 06:06:26 UTC
I have checked this issue but I am unable to reproduce this issue.

Steps I followed:

1. Create an Mobile app ( Xamarin.Forms Portable) project.
2. Add a new content page to the PCL project.
3. Add the following code in newly added content page.
     
     public partial class MyPage : ContentPage
	{	
        public MyPage ()
        {
            var link = new Label {
                Text = "Hello",

            };

            var button = new Button {
                Text = "Animate",
            };

            button.Clicked += async (sender, e) => {
                try {
                    await link.ScaleTo (1.35, 350, Easing.SpringIn);
                    await link.ScaleTo (1, 350, Easing.SpringOut);
                } catch (Exception ex) {
                    Debug.WriteLine (ex.ToString ());
                }
            };

            Content = new StackLayout {
                Children = { button, link },

            };
        }
	}
 
4. Call the content page from App.cs 

     return new MyPage();     

5. Build and deploy the project.
6. Click on Animation button. 

When I deploy the application on emulator (Genymotion & XAP) I am not getting any error/exception with the app. I have tried the same on multiple time but didn't got the reported behavior.

Screencast: http://www.screencast.com/t/Ixw3J2dq

Please let me know if I am missing something.

Environment Info:

Xamarin.Forms : 1.2.2.63

=== Xamarin Studio ===

Version 5.5 (build 193)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Version: 1.11.0.1 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0.30 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.2.0.154 (Business Edition)
Hash: 4df8cee
Branch: 
Build date: 2014-09-16 17:56:45-0400

=== Build Information ===

Release ID: 505000193
Git revision: ca8ebf95737de4f8415e30285b978d071971fc73
Build date: 2014-09-16 16:41:47-04
Xamarin addins: 2a28b0577e979e78b927ba07ed564da3475b8d24

=== Operating System ===

Mac OS X 10.9.3
Darwin Jatin66s-iMac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 3 Eric Grover 2014-09-22 17:04:44 UTC
I think this issue may be related to multiple concurrent animations (on different controls) firing at the same time.  That's when I see it the most often.
Comment 4 Eric Grover 2014-09-22 17:05:14 UTC
09-22 17:01:00.467 I/MonoDroid(11873): UNHANDLED EXCEPTION:
[0:] AndroidEnvironment.UnhandledExceptionRaiser: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2<string, Xamarin.Forms.AnimationExtensions/Info>.get_Item (string) <0x00213>
at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (object,System.EventArgs) <IL 0x00012, 0x00087>
at Xamarin.Forms.Tweener.<Start>b__0 (long) <IL 0x00043, 0x00110>
at Xamarin.Forms.Ticker.SendSignals (int) <IL 0x00064, 0x00267>
at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (object,Android.Animation.ValueAnimator/AnimatorUpdateEventArgs) <IL 0x00002, 0x0002b>
at Android.Animation.ValueAnimator/IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134
at Android.Animation.ValueAnimator/IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85
at (wrapper dynamic-method) object.3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
. IsTerminating: False
AndroidEnvironment.UnhandledExceptionRaiser: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
09-22 17:01:00.467 I/MonoDroid(11873): System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2<string, Xamarin.Forms.AnimationExtensions/Info>.get_Item (string) <0x00213>
at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (object,System.EventArgs) <IL 0x00012, 0x00087>
at Xamarin.Forms.Tweener.<Start>b__0 (long) <IL 0x00043, 0x00110>
at Xamarin.Forms.Ticker.SendSignals (int) <IL 0x00064, 0x00267>
at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (object,Android.Animation.ValueAnimator/AnimatorUpdateEventArgs) <IL 0x00002, 0x0002b>
at Android.Animation.ValueAnimator/IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134
at Android.Animation.ValueAnimator/IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms
09-22 17:01:00.467 I/MonoDroid(11873): at System.Collections.Generic.Dictionary`2<string, Xamarin.Forms.AnimationExtensions/Info>.get_Item (string) <0x00213>
/android-19/src/generated/Android.Animation.ValueAnimator.cs:85
at (wrapper dynamic-method) object.3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
. IsTerminating: False
09-22 17:01:00.467 I/MonoDroid(11873): at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (object,System.EventArgs) <IL 0x00012, 0x00087>
09-22 17:01:00.467 I/MonoDroid(11873): at Xamarin.Forms.Tweener.<Start>b__0 (long) <IL 0x00043, 0x00110>
09-22 17:01:00.467 I/MonoDroid(11873): at Xamarin.Forms.Ticker.SendSignals (int) <IL 0x00064, 0x00267>
09-22 17:01:00.467 I/MonoDroid(11873): at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (object,Android.Animation.ValueAnimator/AnimatorUpdateEventArgs) <IL 0x00002, 0x0002b>
09-22 17:01:00.467 I/MonoDroid(11873): at Android.Animation.ValueAnimator/IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134
09-22 17:01:00.467 I/MonoDroid(11873): at Android.Animation.ValueAnimator/IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85
09-22 17:01:00.467 I/MonoDroid(11873): at (wrapper dynamic-method) object.3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
09-22 17:01:00.495 D/Mono    (11873): DllImport attempting to load: '/system/lib/liblog.so'.
09-22 17:01:00.495 D/Mono    (11873): DllImport loaded library '/system/lib/liblog.so'.
09-22 17:01:00.495 D/Mono    (11873): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
09-22 17:01:00.495 D/Mono    (11873): Searching for '__android_log_print'.
09-22 17:01:00.495 D/Mono    (11873): Probing '__android_log_print'.
09-22 17:01:00.495 D/Mono    (11873): Found as '__android_log_print'.
09-22 17:01:00.495 I/mono-stdout(11873): AndroidEnvironment.UnhandledExceptionRaiser: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
09-22 17:01:00.499 I/mono-stdout(11873): at System.Collections.Generic.Dictionary`2<string, Xamarin.Forms.AnimationExtensions/Info>.get_Item (string) <0x00213>
09-22 17:01:00.499 I/mono-stdout(11873): at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (object,System.EventArgs) <IL 0x00012, 0x00087>
09-22 17:01:00.499 I/mono-stdout(11873): at Xamarin.Forms.Tweener.<Start>b__0 (long) <IL 0x00043, 0x00110>
09-22 17:01:00.499 I/mono-stdout(11873): at Xamarin.Forms.Ticker.SendSignals (int) <IL 0x00064, 0x00267>
09-22 17:01:00.499 I/mono-stdout(11873): at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (object,Android.Animation.ValueAnimator/AnimatorUpdateEventArgs) <IL 0x00002, 0x0002b>
09-22 17:01:00.499 I/mono-stdout(11873): at Android.Animation.ValueAnimator/IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134
09-22 17:01:00.499 I/mono-stdout(11873): at Android.Animation.ValueAnimator/IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85
09-22 17:01:00.499 I/mono-stdout(11873): at (wrapper dynamic-method) object.3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
09-22 17:01:00.499 I/mono-stdout(11873): . IsTerminating: False
An unhandled exception occured.

[0:] 
AppDomain.CurrentDomain.UnhandledException: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
09-22 17:01:01.735 I/mono-stdout(11873): AppDomain.CurrentDomain.UnhandledException: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

  at System.Collections.Generic.Dictionary`2[System.String,Xamarin.Forms.AnimationExtensions+Info].get_Item (System.String key) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Tweener.<Start>b__0 (Int64 step) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Ticker.SendSignals (Int32 timestep) [0x00000] in <filename unknown>:0 
[0:] AppDomain.CurrentDomain.UnhandledException: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,Xamarin.Forms.AnimationExtensions+Info].get_Item (System.String key) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Tweener.<Start>b__0 (Int64 step) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Ticker.SendSignals (Int32 timestep) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (System.Object sender, Android.Animation.AnimatorUpdateEventArgs e) [0x00000] in <filename unknown>:0 
  at Android.Animation.ValueAnimator+IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator animation) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134 
  at Android.Animation.ValueAnimator+IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (IntPtr jnienv, IntPtr native__this, IntPtr native_animation) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85 
  at (wrapper dynamic-method) object:3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr). IsTerminating: True
09-22 17:01:01.735 I/mono-stdout(11873):   at System.Collections.Generic.Dictionary`2[System.String,Xamarin.Forms.AnimationExtensions+Info].get_Item (System.String key) [0x00000] in <filename unknown>:0 

  at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (System.Object sender, Android.Animation.AnimatorUpdateEventArgs e) [0x00000] in <filename unknown>:0 
  at Android.Animation.ValueAnimator+IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator animation) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134 
  at Android.Animation.ValueAnimator+IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (IntPtr jnienv, IntPtr native__this, IntPtr native_animation) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85 
  at (wrapper dynamic-method) object:3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr). IsTerminating: True
09-22 17:01:01.735 I/mono-stdout(11873):   at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0 
09-22 17:01:01.735 I/mono-stdout(11873):   at Xamarin.Forms.Tweener.<Start>b__0 (Int64 step) [0x00000] in <filename unknown>:0 
09-22 17:01:01.735 I/mono-stdout(11873):   at Xamarin.Forms.Ticker.SendSignals (Int32 timestep) [0x00000] in <filename unknown>:0 
09-22 17:01:01.735 I/mono-stdout(11873):   at Xamarin.Forms.Platform.Android.AndroidTicker.<.ctor>b__0 (System.Object sender, Android.Animation.AnimatorUpdateEventArgs e) [0x00000] in <filename unknown>:0 
09-22 17:01:01.735 I/mono-stdout(11873):   at Android.Animation.ValueAnimator+IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator animation) [0x0000d] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:134 
09-22 17:01:01.735 I/mono-stdout(11873):   at Android.Animation.ValueAnimator+IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (IntPtr jnienv, IntPtr native__this, IntPtr native_animation) [0x00011] in /Users/builder/data/lanes/1131/2a7b6821/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Animation.ValueAnimator.cs:85 
09-22 17:01:01.735 I/mono-stdout(11873):   at (wrapper dynamic-method) object:3bb88acd-9ba8-42cf-9fcd-fffcf6d149c3 (intptr,intptr,intptr). IsTerminating: True
09-22 17:01:01.747 E/mono-rt (11873): [ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
The program 'Mono' has exited with code 0 (0x0).
Comment 5 R.Schindler 2015-07-14 05:22:07 UTC
Hey there,
I'm running into this, too.
This is only happening on Android devices.

I've created a Test-Application where you can reproduce the issue. You can get it here: https://github.com/De4th69/XFTest

However I'm only experiencing this when I use the Back button of the device not the back button that is shown!

IMPORTANT: This bug is NOT reproducable on an Emulator for me!!! You MUST run it on a physical device.

How to reprodue:

1. Install the App on a physical device!!!
2. Go further with the next button until you see the navy background
3. Hit the Back button of your device
NOTE: Sometime it takes some time until the bug is hit, but it is definetly reproducable
Comment 6 Rui Marinho 2015-07-15 07:36:09 UTC
Should be fixed  in 1.4.4-pre2
Comment 7 R.Schindler 2015-07-17 07:57:35 UTC
Can confirm this bug is fixed. Thank you :)