4

When I do the first Run, preview on Android Studio will not work and I can't see the preview or add new elements in a layout. I need to restart the Windows application every time, but if I launch the application the bug reappears.

Render issue:

java.lang.IllegalArgumentException: java.lang.ClassCastException@2ad68510    
at java.lang.reflect.Method.invoke(Method.java:498)
at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108)
at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143)
at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java:-1)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
at android.animation.AnimatorSet.start(AnimatorSet.java:729)
at android.animation.AnimatorSet.start(AnimatorSet.java:684)
at android.animation.StateListAnimator.start(StateListAnimator.java:188)
at android.animation.StateListAnimator.setState(StateListAnimator.java:181)
at android.view.View.drawableStateChanged(View.java:21105)
at android.widget.ImageView.drawableStateChanged(ImageView.java:1294)
at com.google.android.material.floatingactionbutton.FloatingActionButton.drawableStateChanged   ... (FloatingActionButton.java:804)
at android.view.View.refreshDrawableState(View.java:21160)
at android.view.View.dispatchAttachedToWindow(View.java:18379)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)

Tip: Try to refresh the layout. 
Marco Concas
  • 1,665
  • 20
  • 25
  • 1
    I've already do "Invalidate Caches / Restart" and changed the style but still not work. – Marco Concas Apr 15 '19 at 11:34
  • The problem has been solved. I've removed the default Floating Action Button and now work. – Marco Concas Apr 15 '19 at 11:55
  • 3
    I don't have Floating Action Button, my stacktrace originates from androidx.appcompat.widget.AppCompatButton.drawableStateChanged. I'm very dissapointed, nothing helps – ievgen Apr 19 '19 at 14:01
  • Sorry but it will not help. Try to explain your problem or open a new thread. – Marco Concas Apr 21 '19 at 08:15
  • For me, this goes away only when I comment out the Button in my xml. Still trying to find the culprit within the button class that causes it. – amitavk Apr 27 '19 at 09:50
  • 1
    It seems to be related to button elevation. Here's a workaround: https://stackoverflow.com/a/55880655/3460025 – amitavk Apr 27 '19 at 12:44

0 Answers0