So the issue is definitely something watch face related. This exception does not occur on the same watch face created with older WFS 1.3.13.
java.lang.IllegalArgumentException: value must be between min and max
WireComplicationData.toApiComplicationData failed for ComplicationData{mType=5, mFields=Bundle[{FIELD_DATA_SOURCE=ComponentInfo{com.samsung.android.wear.shealth/com.samsung.android.wear.shealth.complications.steps.StepsComplicationProviderService}, MAX_VALUE=1000.0, MIN_VALUE=0.0, SHORT_TITLE=ComplicationText{mSurroundingText=REDACTED, mTimeDependentText=null, mStringExpression=null}, VALUE=1141.0, IMAGE_CONTENT_DESCRIPTION=ComplicationText{mSurroundingText=REDACTED, mTimeDependentText=null, mStringExpression=null}, TAP_ACTION=PendingIntent{dd96b9d: android.os.BinderProxy@ccad812}, SHORT_TEXT=ComplicationText{mSurroundingText=REDACTED, mTimeDependentText=null, mStringExpression=null}}]}
java.lang.IllegalArgumentException: value must be between min and max
at j1.u$a.<init>(Unknown Source:90)
at j1.f.g(Unknown Source:284)
at g1.v0$a.emit(Unknown Source:44)
at v7.h.collect(Unknown Source:238)
at g1.v0.k(Unknown Source:37)
at h7.a.g(Unknown Source:7)
at t7.i0.run(Unknown Source:100)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:7690)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
2023-05-12 06:30:37.959 5708-5708 AndroidRuntime [536889744340690] E FATAL EXCEPTION: main
Process: com.watchfacestudio.Test_4147697655774695536889744340690, PID: 5708
java.lang.IllegalArgumentException: value must be between min and max
at j1.u$a.<init>(Unknown Source:90)
at j1.f.g(Unknown Source:284)
at g1.v0$a.emit(Unknown Source:44)
at v7.h.collect(Unknown Source:238)
at g1.v0.k(Unknown Source:37)
at h7.a.g(Unknown Source:7)
at t7.i0.run(Unknown Source:100)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:7690)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Suppressed: t7.g0: [l1{Cancelling}@d7a635e, Handler (android.os.Handler) {17233f}.immediate]
This leads to multiple crashes… then the service is completely broken and complication slot cannot be used again
E channel '95e7e07 com.samsung.android.wearable.watchfacestudio.WatchFaceStudioRuntime (server)' ~ Channel is unrecoverably broken and will be disposed!
RangedValueError.wfs.zip (164.3 KB)
Full Dump:
dumpState_R870XXU1GWD6_202305120744.zip (4.7 MB)
pid: com.watchfacestudio.Test_4147697655774695536889744340690
EDIT: Maybe this is something which needs to be finally fixed on S Health app side? Some simple check for value to not go over max value because new Watch Face Format | Android Developers cannot handle it correctly?
EDIT2: Based on GoalProgressComplicationData | Android Developers documentation,
RangedValueComplicationData
is allowed to be larger than targetValue
(e.g. you’ve done 12000 steps) and renderers may chose to acknowledge this in a special way (e.g. by colorizing part of the progress bar in a different color to indicate progress past the goal).
So looks like this can still be fixed on watch face side, or not? If not, because we use new Watch Face Format, S Health needs an update for this. Either switch to GoalProgressComplicationData.Builder or use some simple check for ranged value
val value = if (stepscount <= stepsgoal) stepscount else stepsgoal
EDIT3: I had to edit my HS Complication app too to have it working, but this obviously requires fix on watch face side because Ranged Value should be allowed to go above Max