Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] ScaleTo IllegalArgumentException (Android only) #13236

Closed
mknotzer opened this issue Dec 27, 2020 · 5 comments · Fixed by #14606
Closed

[Bug] ScaleTo IllegalArgumentException (Android only) #13236

mknotzer opened this issue Dec 27, 2020 · 5 comments · Fixed by #14606
Labels
a/frame e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android t/bug 🐛

Comments

@mknotzer
Copy link

calling ScaleTo twice causes an Exception on Android

await oFrame.ScaleTo(0.2, 0); // ok
await oFrame.ScaleTo(0.2, 0); // exception

XF 4.8.0.1821

Java.Lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in <89755ea61d9c4ae0a40ce90b872c9e2d>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <89755ea61d9c4ae0a40ce90b872c9e2d>:0
at Android.Views.View.set_ScaleX (System.Single value) [0x00022] in <2df86f44c8e946618f31cb3aed952f5b>:0
at Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateScale () [0x00017] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:397
at Xamarin.Forms.Platform.Android.VisualElementTracker.HandlePropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x002eb] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:170
at Xamarin.Forms.Platform.Android.VisualElementTracker.HandleRedrawNeeded (System.Object sender, Xamarin.Forms.Internals.EventArg`1[T] e) [0x00015] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:194
at Xamarin.Forms.VisualElement.BatchCommit () [0x0001c] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:620
at Xamarin.Forms.AnimationExtensions.HandleTweenerUpdated (System.Object o, System.EventArgs args) [0x0004f] in D:\a\1\s\Xamarin.Forms.Core\AnimationExtensions.cs:276
at Xamarin.Forms.Tweener.b__27_0 (System.Int64 step) [0x00078] in D:\a\1\s\Xamarin.Forms.Core\Tweener.cs:108
at Xamarin.Forms.Internals.Ticker.SendSignals (System.Int64 step) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\Internals\Ticker.cs:136
at Xamarin.Forms.Internals.Ticker.SendSignals (System.Int32 timestep) [0x00014] in D:\a\1\s\Xamarin.Forms.Core\Internals\Ticker.cs:125
at Xamarin.Forms.Platform.Android.AndroidTicker.OnValOnUpdate (System.Object sender, Android.Animation.ValueAnimator+AnimatorUpdateEventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AndroidTicker.cs:117
at Android.Animation.ValueAnimator+IAnimatorUpdateListenerImplementor.OnAnimationUpdate (Android.Animation.ValueAnimator animation) [0x00017] in <2df86f44c8e946618f31cb3aed952f5b>:0
at Android.Animation.ValueAnimator+IAnimatorUpdateListenerInvoker.n_OnAnimationUpdate_Landroid_animation_ValueAnimator_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_animation) [0x0000f] in <2df86f44c8e946618f31cb3aed952f5b>:0
at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.196(intptr,intptr,intptr)
at java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN

@mknotzer mknotzer added s/unverified New report that has yet to be verified t/bug 🐛 labels Dec 27, 2020
@samhouts samhouts added this to New in Triage Dec 27, 2020
@hartez
Copy link
Contributor

hartez commented Jan 4, 2021

@mknotzer I'm trying to reproduce this issue, but so far I'm not having any success. Calling ScaleTo twice on a Frame isn't throwing an exception.

I've attached my repro project - is there a detail I'm missing?

_13236 Repro.zip

@hartez hartez moved this from New to Needs Estimate in Triage Jan 4, 2021
@hartez hartez moved this from Needs Estimate to Needs Info in Triage Jan 4, 2021
@hartez hartez added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jan 4, 2021
@mknotzer
Copy link
Author

Android crashes now already at the first call.

changing
await oView.ScaleTo(0.2, 0);
to
await oView.ScaleTo(0.2, 10);

fixed it.

btw: the View was set to Invisible = False

@mknotzer
Copy link
Author

mknotzer commented Jan 14, 2021

@hartez Your project crashes at the second call, testet with Android Emulator Pixel 2 Pie (API 28)

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jan 21, 2021
@PureWeen PureWeen moved this from Needs Info to New in Triage Jan 22, 2021
@rachelkang
Copy link
Contributor

am able to reproduce the crash on @hartez's repro as described

@rachelkang rachelkang added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often a/frame and removed s/unverified New report that has yet to be verified labels Feb 2, 2021
@rachelkang
Copy link
Contributor

also seeing this on the latest version! XF 5.0.0.1931

@rachelkang rachelkang moved this from New to Ready For Work in Triage Feb 2, 2021
Triage automation moved this from Ready For Work to Closed Nov 16, 2021
5.0.0 SR8 (Planning) - Target Date Dec. 15th automation moved this from To Fix to Done Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/frame e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android t/bug 🐛
Projects
Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

4 participants