[flutter_svg] Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future #158835
Labels
p: flutter_svg
The Flutter SVG drawing packages
P2
Important issues not at the top of the work list
package
flutter/packages repository. See also p: labels.
Imported from dnfield/flutter_svg#1099
Original report by @8symbols on Sep 2, 2024
If you provide a
bundle
argument toSvgPicture.asset
and useImage.asset(...)
, then in profile and release modes the following exception will be thrown and svg won't be displayed:Exception
That's because CachingAssetBundle stores futures in its fields, SvgAssetLoader stores bundle (if you provided one) and SvgLoader somehow sends it to other isolate in compute.
Debug build doesn't have this problem because it doesn't use other isolate.
Reproducible with Flutter 3.24.1 and
flutter_svg: 2.0.10+1
.Sample app
assets/any_svg.svg
andassets/any_png.png
are literally any svg and png files respectively.Problem can be fixed with the following change, but I don't sure how adequate it is.
Change that fixes problem
The text was updated successfully, but these errors were encountered: