2d-inc / Flare-Flutter

Load and get full control of your Rive files in a Flutter project using this library.
https://rive.app/
MIT License
2.55k stars 469 forks source link

RangeError #191

Closed stormagain closed 4 years ago

stormagain commented 4 years ago

E/flutter (22329): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: RangeError (byteOffset): Invalid value: Not in range 0..129, inclusive: 130 E/flutter (22329): #0 _ByteDataView.getUint16 (dart:typed_data-patch/typed_data_patch.dart:4367:7) E/flutter (22329): #1 BinaryReader.readUint16Array (package:flare_dart/binary_reader.dart:66:22) E/flutter (22329): #2 ActorImage.read (package:flare_dart/actor_image.dart:147:32) E/flutter (22329): #3 ActorArtboard.readComponentsBlock (package:flare_dart/actor_artboard.dart:372:34) E/flutter (22329): #4 ActorArtboard.read (package:flare_dart/actor_artboard.dart:325:11) E/flutter (22329): #5 Actor.readArtboardsBlock (package:flare_dart/actor.dart:165:22) E/flutter (22329): #6 Actor.load (package:flare_dart/actor.dart:137:11) E/flutter (22329):
E/flutter (22329): #7 FlutterActor.loadFromByteData (package:flare_flutter/flare.dart:746:17) E/flutter (22329):
E/flutter (22329): #8 _IsolateConfiguration.apply (package:flutter/src/foundation/_isolates_io.dart:77:16) E/flutter (22329): #9 _spawn. (package:flutter/src/foundation/_isolates_io.dart:84:45) E/flutter (22329):
E/flutter (22329): #10 Timeline.timeSync (dart:developer/timeline.dart:161:22) E/flutter (22329): #11 _spawn (package:flutter/src/foundation/_isolates_io.dart:82:18)

maybe some bug appears when export a .flr file since 2019.11.13

umberto-sonnino commented 4 years ago

If possible, could you share you flr file and the file on 2Dimensions.com?

stormagain commented 4 years ago

https://www.2dimensions.com/a/tianmingatm/files/flare/chi-xi-gua/preview

https://www.2dimensions.com/a/tianmingatm/files/flare/zhang-yu-chu-xian/preview

@umberto-sonnino

stormagain commented 4 years ago

flare_flutter: ^1.5.15

umberto-sonnino commented 4 years ago

flare_flutter: ^1.5.15

I think that this might be the problem, our current version is 1.7.0. I've just tested them on my end, and they seem to be displaying correctly. Cool animations btw =)

stormagain commented 4 years ago

when i try it on 1.7.0. E/flutter (14780): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: RangeError (byteOffset): Invalid value: Not in range 0..129, inclusive: 130 E/flutter (14780): #0 _ByteDataView.getUint16 (dart:typed_data-patch/typed_data_patch.dart:4367:7) E/flutter (14780): #1 BinaryReader.readUint16Array (package:flare_dart/binary_reader.dart:66:22) E/flutter (14780): #2 ActorImage.read (package:flare_dart/actor_image.dart:147:32) E/flutter (14780): #3 ActorArtboard.readComponentsBlock (package:flare_dart/actor_artboard.dart:372:34) E/flutter (14780): #4 ActorArtboard.read (package:flare_dart/actor_artboard.dart:325:11) E/flutter (14780): #5 Actor.readArtboardsBlock (package:flare_dart/actor.dart:165:22) E/flutter (14780): #6 Actor.load (package:flare_dart/actor.dart:137:11) E/flutter (14780):
E/flutter (14780): #7 FlutterActor.loadFromByteData (package:flare_flutter/flare.dart:746:17) E/flutter (14780):
E/flutter (14780): #8 _IsolateConfiguration.apply (package:flutter/src/foundation/_isolates_io.dart:77:16) E/flutter (14780): #9 _spawn. (package:flutter/src/foundation/_isolates_io.dart:84:45) E/flutter (14780):
E/flutter (14780): #10 Timeline.timeSync (dart:developer/timeline.dart:161:22) E/flutter (14780): #11 _spawn (package:flutter/src/foundation/_isolates_io.dart:82:18) E/flutter (14780):
E/flutter (14780): #12 _startIsolate. (dart:isolate-patch/isolate_patch.dart:308:17) E/flutter (14780): #13 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12) E/flutter (14780):

Compiler message: ../../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.7.0/lib/flare.dart:1109:11: Error: No named parameter with the name 'cacheWidth'. cacheWidth: cacheWidth, cacheHeight: cacheHeight);
^^^^^^^^^^
../../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.7.0/lib/flare.dart:1106:33: Error: Too many positional arguments: 1 allowed, but 2 found. Try removing the extra positional arguments.
var load = networkImage.load(val, (Uint8List bytes,
^

my flutter version is 1.9.1+hotfix.6

umberto-sonnino commented 4 years ago

I apologize, the latest version is 1.7.1, that should fix the problem that you just saw. Also, did you try just re-exporting the file?

stormagain commented 4 years ago

Thank you, when i upgrade to 1.7.1, it works. can you provide a old version tool match 1.5.15 ? @umberto-sonnino

umberto-sonnino commented 4 years ago

I'm not sure I understand, do you need a version of your file that works with 1.5.15? What's your use case?

stormagain commented 4 years ago

It's a long story, my team is trying out dynamic deploy code on ios with flutter, we code in dart, compile it to js, run in flutter. When we used flare-flutter, We appreciate it very much, so we integrate it in our host ,the version is 1.5.15, currently we need a tool to export .flr file that work on 1.5.15. @umberto-sonnino

umberto-sonnino commented 4 years ago

We totally understand the use case, and really want to start supporting it soon! Unfortunately, it's not supported in Flare just yet. We've been exploring a solution, and we want to get it out there in the upcoming months, but it won’t be backward-compatible with older versions of Flare.

In the meantime, is there anything we can do to help get you upgraded to 1.7.1? We’re really curious about dynamic deploy too and would love to see if we can help.

stormagain commented 4 years ago

Thanks for your reply,this time we have a plan B, and upgrade our host app to 1.7.1 soon.