{"record":{"id":"95ed00bf3e33e357","repo":"material-components/material-components-android","slug":"invalid-motion-easing-type-s","errorCode":null,"errorMessage":"Invalid motion easing type: %s","messagePattern":"Invalid motion easing type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"lib/java/com/google/android/material/motion/MotionUtils.java","lineNumber":154,"sourceCode":"      String controlPointsString = getLegacyEasingContent(easingString, EASING_TYPE_CUBIC_BEZIER);\n      String[] controlPoints = controlPointsString.split(\",\");\n      if (controlPoints.length != 4) {\n        throw new IllegalArgumentException(\n            \"Motion easing theme attribute must have 4 control points if using bezier curve\"\n                + \" format; instead got: \"\n                + controlPoints.length);\n      }\n\n      float controlX1 = getLegacyControlPoint(controlPoints, 0);\n      float controlY1 = getLegacyControlPoint(controlPoints, 1);\n      float controlX2 = getLegacyControlPoint(controlPoints, 2);\n      float controlY2 = getLegacyControlPoint(controlPoints, 3);\n      return new PathInterpolator(controlX1, controlY1, controlX2, controlY2);\n    } else if (isLegacyEasingType(easingString, EASING_TYPE_PATH)) {\n      String path = getLegacyEasingContent(easingString, EASING_TYPE_PATH);\n      return new PathInterpolator(PathParser.createPathFromPathData(path));\n    } else {\n      throw new IllegalArgumentException(\"Invalid motion easing type: \" + easingString);\n    }\n  }\n\n  private static boolean isLegacyEasingAttribute(String easingString) {\n    return isLegacyEasingType(easingString, EASING_TYPE_CUBIC_BEZIER)\n        || isLegacyEasingType(easingString, EASING_TYPE_PATH);\n  }\n\n  private static boolean isLegacyEasingType(String easingString, String easingType) {\n    return easingString.startsWith(easingType + EASING_TYPE_FORMAT_START)\n        && easingString.endsWith(EASING_TYPE_FORMAT_END);\n  }\n\n  private static String getLegacyEasingContent(String easingString, String easingType) {\n    return easingString.substring(\n        easingType.length() + EASING_TYPE_FORMAT_START.length(),\n        easingString.length() - EASING_TYPE_FORMAT_END.length());\n  }","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/material-components/material-components-android/blob/ac7e18efeefb331850c561faf9ab8bf81d27ba68/lib/java/com/google/android/material/motion/MotionUtils.java#L136-L172","documentation":"After confirming a legacy easing string starts with 'cubic-bezier(' or 'pathData:' style prefixes (isLegacyEasingAttribute), getLegacyThemeInterpolator tries both known types; if neither matches it throws IllegalArgumentException('Invalid motion easing type: ...'). This catches strings that look like legacy easings (e.g. end with ')') but use an unrecognized function name.","triggerScenarios":"A theme string easing like 'ease-in-out(...)' or 'spring(1,2)' — starts with an unknown function and ends with ')' — resolved via resolveThemeInterpolator; the type check for cubic-bezier/pathData prefixes fails and the else branch throws.","commonSituations":"Porting CSS easing names (ease-in, ease-out) that Material does not support; typos like 'cubicBezier(...)' or 'path(...)'; expecting spring strings to work.","solutions":["Use only 'cubic-bezier(x1,y1,x2,y2)' or 'pathData:<android path string>' string formats","Replace custom curves with an @interpolator resource and the *Interpolator attribute variant","For standard curves, use built-in theme defaults rather than overriding with a string"],"exampleFix":"<!-- before -->\n<item name=\"motionEasingStandard\">easeInOut(0.4, 0, 0.2, 1)</item>\n<!-- after -->\n<item name=\"motionEasingStandard\">cubic-bezier(0.4, 0, 0.2, 1)</item>","handlingStrategy":"validation","validationCode":"fun isSupportedEasingString(s: String): Boolean =\n    s.startsWith(\"cubic-bezier(\") && s.endsWith(\")\") ||\n    s.startsWith(\"pathData:\")","typeGuard":null,"tryCatchPattern":"catch (e: IllegalArgumentException) { Log.w(TAG, \"Unsupported easing type; falling back\", e); useDefaultInterpolator() }","preventionTips":["Only use the two supported string easing function names","Do not port CSS easing keywords (ease-in-out etc.) directly","Move custom curves to interpolator resource files"],"tags":["android","material-components","animation","easing","theme-attribute"],"backgroundTag":null,"analyzedSha":"ac7e18efeefb331850c561faf9ab8bf81d27ba68","analyzedAt":"2026-08-14T15:35:35.735Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}