Flame 2D范围错误(字节偏移),无明显原因

时间:2019-05-19 13:44:54

标签: dart flutter flutter-dependencies flutter-animation

由于某种原因,flameActor导致错误

  

RangeError(byteOffset):无效值:不在0..24范围内(包括27)

我进行了搜索,但没有发现任何错误。 我导出了二进制文件,并且一切正常,但是由于某种原因导致了错误。 我无法弄清楚我做错了什么,因为我遵循了确切的说明。


class HomePage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
     body: Stack(
       children: <Widget>[
         wallPaper(),
         FlareActor(
           "assets/fish.flr"
         )
       ],
     )
    );
  }
}

这是堆栈:

E/flutter ( 7426): [ERROR:flutter/shell/common/shell.cc(178)] Dart Error: Unhandled exception:
E/flutter ( 7426): RangeError (byteOffset): Invalid value: Not in range 0..24, inclusive: 27
E/flutter ( 7426): #0      _ByteDataView.getFloat32 (dart:typed_data/runtime/libtyped_data_patch.dart:4308:7)
E/flutter ( 7426): #1      BinaryReader.readFloat32 (package:flare_dart/binary_reader.dart:25:25)
E/flutter ( 7426): #2      KeyFrameNumeric.read (package:flare_dart/animation/keyframe.dart:114:27)
E/flutter ( 7426): #3      KeyFrameOpacity.read (package:flare_dart/animation/keyframe.dart:364:25)
E/flutter ( 7426): #4      PropertyAnimation.read (package:flare_dart/animation/actor_animation.dart:155:38)
E/flutter ( 7426): #5      ComponentAnimation.read (package:flare_dart/animation/actor_animation.dart:237:61)
E/flutter ( 7426): #6      ActorAnimation.read (package:flare_dart/animation/actor_animation.dart:428:30)
E/flutter ( 7426): #7      ActorArtboard.readAnimationsBlock (package:flare_dart/actor_artboard.dart:587:30)
E/flutter ( 7426): #8      ActorArtboard.read (package:flare_dart/actor_artboard.dart:327:11)
E/flutter ( 7426): #9      Actor.readArtboardsBlock (package:flare_dart/actor.dart:160:22)
E/flutter ( 7426): #10     Actor.load (package:flare_dart/actor.dart:132:11)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #11     FlutterActor.loadFromByteData (package:flare_flutter/flare.dart:652:17)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #12     FlareCacheAsset.load.<anonymous closure> (package:flare_flutter/flare_cache_asset.dart:17:22)
E/flutter ( 7426): #13     _RootZone.runUnary (dart:async/zone.dart:1379:54)
E/flutter ( 7426): #14     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 7426): #15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 7426): #16     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 7426): #17     Future._complete (dart:async/future_impl.dart:473:7)
E/flutter ( 7426): #18     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter ( 7426): #19     _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
E/flutter ( 7426): #20     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:294:13)
E/flutter ( 7426): #21     PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #22     FlareCacheAsset.load (package:flare_flutter/flare_cache_asset.dart:16:20)
E/flutter ( 7426): #23     Cache.getAsset (package:flare_flutter/cache.dart:55:15)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #24     cachedActor (package:flare_flutter/flare_cache.dart:35:16)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #25     FlareRenderBox.loadFlare (package:flare_flutter/flare_render_box.dart:226:35)
E/flutter ( 7426): <asynchronous suspension>
E/flutter ( 7426): #26     FlareActorRenderObject.load (package:flare_flutter/flare_actor.dart:220:5)
E/flutter ( 7426): #27     FlareActorRenderObject.filename= (package:flare_flutter/flare_actor.dart:214:5)
E/flutter ( 7426): #28     FlareActor.updateRenderObject (package:flare_flutter/flare_actor.dart:64:9)
E/flutter ( 7426): #29     RenderObjectElement.update (package:flutter/src/widgets/framework.dart:4510:12)
E/flutter ( 7426): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
E/flutter ( 7426): #31     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)
E/flutter ( 7426): #32     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4992:17)
E/flutter ( 7426): #33     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
E/flutter ( 7426): #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter ( 7426): #35     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter ( 7426): #36     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
E/flutter ( 7426): #37     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
E/flutter ( 7426): #38     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter ( 7426): #39     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter ( 7426): #40     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
E/flutter ( 7426): #41     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
E/flutter ( 7426): #42     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)
E/flutter ( 7426): #43     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4992:17)
E/flutter ( 7426): #44     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
E/flutter ( 7426): #45     ComponentElement.performRebuild (package:flutter/src/widgets

0 个答案:

没有答案