Bug 24247 - Android: Java Exception after some time running animation
Summary: Android: Java Exception after some time running animation
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Other Other
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-04 06:46 UTC by Tim Brand
Modified: 2014-12-04 16:10 UTC (History)
6 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 Tim Brand 2014-11-04 06:46:27 UTC
I'm working on an app where we've created a screen similar to the homescreen of WindowsPhone, with the tiles (flipping animation also) and a slide of news messages in the top that fades trough all news items with an image and text label. After some time of running the app, sometimes 1 minute, but most of the times around 5 minutes, the app creashes.

I reported the issue on the forums (http://forums.xamarin.com/discussion/27260/android-java-exception-after-some-time-of-running-animations) but got the advice to report in here.

I hope the Android log will have enough information.

11-04 09:25:06.926 I/mono-stdout( 3293): Starting rotate of tile with index=1
11-04 09:25:06.926 I/mono-stdout( 3293): Rotate finished of tile with index=1
11-04 09:25:07.596 I/mono-stdout( 3293): Schoolreis: ShowSlide() Headline={0}
11-04 09:25:07.746 I/mono-stdout( 3293): Schoolreis: ShowSlide() Headline={0}
11-04 09:25:08.936 E/qcom_sensors_hal(  751): hal_process_report_ind: Bad item quality: 11
11-04 09:25:09.386 I/mono-stdout( 3293): Selecting tile with index=2 for rotate
11-04 09:25:09.386 I/mono-stdout( 3293): Starting rotate of tile with index=2
11-04 09:25:09.396 I/mono-stdout( 3293): Rotate finished of tile with index=2
11-04 09:25:09.676 I/mono-stdout( 3293): Selecting tile with index=2 for rotate
11-04 09:25:09.676 I/mono-stdout( 3293): Starting rotate of tile with index=2
11-04 09:25:09.676 I/mono-stdout( 3293): Rotate finished of tile with index=2
11-04 09:25:10.856 I/mono-stdout( 3293): Camping Julianahoeve tevreden: ShowSlide() Headline={0}
11-04 09:25:10.986 I/mono-stdout( 3293): Camping Julianahoeve tevreden: ShowSlide() Headline={0}
11-04 09:25:11.796 D/dalvikvm( 3293): GC_CONCURRENT freed 15304K, 23% free 20698K/26696K, paused 4ms+1ms, total 45ms
11-04 09:25:11.796 D/Mono    ( 3293): GC_BRIDGE waiting for bridge processing to finish
11-04 09:25:11.806 D/dalvikvm( 3293): GC_EXPLICIT freed 2K, 23% free 20696K/26696K, paused 1ms+2ms, total 16ms
11-04 09:25:11.816 D/Mono    ( 3293): GC_OLD_BRIDGE num-objects 217 num_hash_entries 296 sccs size 296 init 0.00ms df1 0.55ms sort 0.06ms dfs2 0.47ms setup-cb 0.17ms free-data 0.11ms links 87/87/87/2 dfs passes 600/383
11-04 09:25:11.816 D/Mono    ( 3293): GC_MAJOR: (LOS overflow) pause 20.08ms, total 20.69ms, bridge 18.25ms major 2896K/2864K los 102K/16486K
11-04 09:25:11.846 E/mono    ( 3293):
11-04 09:25:11.846 E/mono    ( 3293): Unhandled Exception:
11-04 09:25:11.846 E/mono    ( 3293): Java.Lang.IllegalStateException: Exception of type 'Java.Lang.IllegalStateException' was thrown.
11-04 09:25:11.846 E/mono    ( 3293):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Android.Runtime.JNIEnv.CallVoidMethod (IntPtr jobject, IntPtr jmethod) [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Android.Animation.Animator.Cancel () [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Platform.Android.AndroidTicker.DisableTimer () [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Ticker.Disable () [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Ticker.Remove (Int32 handle) [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Tweener.Finalize () [0x00000] in <filename unknown>:0
11-04 09:25:11.846 E/mono    ( 3293):   --- End of managed exception stack trace ---
11-04 09:25:11.846 E/mono    ( 3293): java.lang.IllegalStateException: The current thread must have a looper!
11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer$1.initialValue(Choreographer.java:96)
11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer$1.initialValue(Choreographer.java:91)
11-04 09:25:11.846 E/mono    ( 3293):       at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
11-04 09:25:11.846 E/mono    ( 3293):       at java.lang.ThreadLocal.get(ThreadLocal.java:65)
11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer.getInstance(Choreographer.java:194)
11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator$AnimationHandler.<init>(ValueAnimator.java:578)
11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator$AnimationHandler.<init>(ValueAnimator.java:553)
11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator.getOrCreateAnimationHandler(ValueAnimator.java:1334)
11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator.cancel(ValueAnimator.java:953)
11-04 09:25:11.846 E/mono    ( 3293):       at dalvik.system.NativeStart.run(Native Method)
11-04 09:25:11.846 E/mono    ( 3293):
11-04 09:25:11.876 I/ActivityManager(  751): Process com.advantive.smartme (pid 3293) has died.
11-04 09:25:11.876 I/WindowState(  751): WIN DEATH: Window{434dbcd0 u0 com.advantive.smartme/smartme.droid.MainActivity}
11-04 09:25:11.886 W/ActivityManager(  751): Force removing ActivityRecord{4345afe0 u0 com.advantive.smartme/smartme.droid.MainActivity t3}: app died, no saved state
11-04 09:25:11.896 D/Zygote  (  181): Process 3293 exited cleanly (255)
11-04 09:25:11.986 W/Binder  (  966): Caught a RuntimeException from the binder stub implementation.
11-04 09:25:11.986 W/Binder  (  966): java.lang.NullPointerException
11-04 09:25:11.986 W/Binder  (  966):       at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
11-04 09:25:11.986 W/Binder  (  966):       at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
11-04 09:25:11.986 W/Binder  (  966):       at android.os.Binder.execTransact(Binder.java:404)
11-04 09:25:11.986 W/Binder  (  966):       at dalvik.system.NativeStart.run(Native Method)
11-04 09:25:11.986 W/InputMethodManagerService(  751): Got RemoteException sending setActive(false) notification to pid 3293 uid 10098
11-04 09:25:12.026 E/qcom_sensors_hal(  751): hal_process_report_ind: Bad item quality: 11
11-04 09:25:12.036 D/dalvikvm( 1418): GC_FOR_ALLOC freed 194K, 8% free 18674K/20292K, paused 15ms, total 15ms
11-04 09:25:12.036 I/MicrophoneInputStream( 1418): mic_starting fib@431468c8
11-04 09:25:12.056 D/dalvikvm( 1418): GC_CONCURRENT freed 22K, 5% free 19299K/20292K, paused 2ms+3ms, total 20ms
11-04 09:25:12.056 I/HotwordRecognitionRnr( 1418): Starting hotword detection.
11-04 09:25:12.066 D/audio_hw_primary(  183): select_devices: out_snd_device(0: ) in_snd_device(35: voice-rec-mic)
11-04 09:25:12.066 D/        (  183): Failed to fetch the lookup information of the device 0000003E
11-04 09:25:12.066 E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
Comment 1 Jonathan Pryor 2014-11-04 22:41:15 UTC
Xamarin.Forms is accessing the Animator from the finalizer thread:

> 11-04 09:25:11.846 E/mono    ( 3293):   at Android.Runtime.JNIEnv.CallVoidMethod (IntPtr jobject, IntPtr jmethod) [0x00000] in <filename unknown>:0
> 11-04 09:25:11.846 E/mono    ( 3293):   at Android.Animation.Animator.Cancel () [0x00000] in <filename unknown>:0
> 11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Platform.Android.AndroidTicker.DisableTimer () [0x00000] in <filename unknown>:0
> 11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Ticker.Disable () [0x00000] in <filename unknown>:0
> 11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Ticker.Remove (Int32 handle) [0x00000] in <filename unknown>:0
> 11-04 09:25:11.846 E/mono    ( 3293):   at Xamarin.Forms.Tweener.Finalize () [0x00000] in <filename unknown>:0

The Animator type doesn't like that:

> 11-04 09:25:11.846 E/mono    ( 3293): java.lang.IllegalStateException: The current thread must have a looper!
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer$1.initialValue(Choreographer.java:96)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer$1.initialValue(Choreographer.java:91)
> 11-04 09:25:11.846 E/mono    ( 3293):       at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
> 11-04 09:25:11.846 E/mono    ( 3293):       at java.lang.ThreadLocal.get(ThreadLocal.java:65)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.view.Choreographer.getInstance(Choreographer.java:194)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator$AnimationHandler.<init>(ValueAnimator.java:578)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator$AnimationHandler.<init>(ValueAnimator.java:553)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator.getOrCreateAnimationHandler(ValueAnimator.java:1334)
> 11-04 09:25:11.846 E/mono    ( 3293):       at android.animation.ValueAnimator.cancel(ValueAnimator.java:953)
> 11-04 09:25:11.846 E/mono    ( 3293):       at dalvik.system.NativeStart.run(Native Method)

See also:

https://github.com/android/platform_frameworks_base/blob/5182c780a8b42acd46a06d693ab63a0dd78c6d70/core/java/android/view/Choreographer.java#L96
Comment 2 David Johnson 2014-11-13 14:04:23 UTC
Any status or workaround for this bug? I'm encountering it and am currently blocked.
Comment 3 Tim Brand 2014-11-27 03:32:09 UTC
Any update on this issue?
It's happening randomly in our apps, which is kind of annoying.
Comment 4 Jason Smith [MSFT] 2014-12-04 16:10:12 UTC
Fixed in next pre-release