{
  "id": "flutter/rive-animation-cache-overflow",
  "signature": "RiveError: Animation cache overflow: too many active animations in the same RiveArtboard",
  "signature_zh": "RiveError：动画缓存溢出：同一 RiveArtboard 中活动动画过多",
  "regex": "RiveError: Animation cache overflow: too many active animations in the same RiveArtboard",
  "domain": "flutter",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The Rive animation runtime has a limit on the number of simultaneously playing animations per Artboard (default ~64), which is exceeded when many animations are started without stopping previous ones.",
  "root_cause_type": "generic",
  "root_cause_zh": "Rive 动画运行时对每个 Artboard 同时播放的动画数量有限制（默认约 64 个），当启动许多动画而未停止之前的动画时，会超过该限制。",
  "versions": [
    {
      "version": "Flutter 3.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Dart 3.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rive_common 0.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "flare_flutter 3.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Modifying third-party library source is not maintainable and will be overwritten on package updates; also, increasing cache size may cause memory pressure.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The runtime does not automatically clean up old animations; each new `play()` call adds to the cache without removing previous instances.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Rive animations are independent; a single controller cannot manage multiple simultaneous animations with different timelines.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Stop animations before playing new ones: `artboard.animations.forEach((a) => a.stop()); artboard.animationByName('newAnimation')?.play();`",
      "success_rate": 0.85,
      "how": "Stop animations before playing new ones: `artboard.animations.forEach((a) => a.stop()); artboard.animationByName('newAnimation')?.play();`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a pooling mechanism that reuses animation instances: maintain a list of active animations and remove completed ones using `animation.isActive` check.",
      "success_rate": 0.8,
      "how": "Implement a pooling mechanism that reuses animation instances: maintain a list of active animations and remove completed ones using `animation.isActive` check.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `artboard.animations.clear()` to remove all animation states before loading a new set of animations in a scene transition.",
      "success_rate": 0.75,
      "how": "Use `artboard.animations.clear()` to remove all animation states before loading a new set of animations in a scene transition.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Stop animations before playing new ones: `artboard.animations.forEach((a) => a.stop()); artboard.animationByName('newAnimation')?.play();`",
    "Implement a pooling mechanism that reuses animation instances: maintain a list of active animations and remove completed ones using `animation.isActive` check.",
    "Use `artboard.animations.clear()` to remove all animation states before loading a new set of animations in a scene transition."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pub.dev/packages/rive",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.81,
  "fix_success_rate": 0.76,
  "resolvable": "true",
  "first_seen": "2024-06-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}