LXD312569496 / flutter-learing

学习flutter的一些记录
280 stars 150 forks source link

Any Idea unable to load asset E/flutter (21416): Unable to load asset: assets/robot #1

Open butterl opened 5 years ago

butterl commented 5 years ago

Thanks for sharing these goods demos for flutter beginers!

I tried directly build the repo and,seems could not find resource Tried this still return same error

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...
D/OpenGLRenderer(21416): Swap behavior 0
D/EGL_emulation(21416): eglCreateContext: 0xe465d040: maj 2 min 0 rcv 2
D/EGL_emulation(21416): eglMakeCurrent: 0xe465d040: ver 2 0 (tinfo 0xe2b53b20)
D/EGL_emulation(21416): eglCreateContext: 0xe465d1c0: maj 2 min 0 rcv 2
Syncing files to device Android SDK built for x86...
D/EGL_emulation(21416): eglMakeCurrent: 0xe465d1c0: ver 2 0 (tinfo 0xe2b2acb0)
I/Choreographer(21416): Skipped 30 frames!  The application may be doing too much work on its main thread.
E/flutter (21416): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (21416): Unable to load asset: assets/robot
E/flutter (21416): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
E/flutter (21416): <asynchronous suspension>
E/flutter (21416): #1      FlutterActor.loadFromBundle (package:nima/nima.dart:190:38)
E/flutter (21416): <asynchronous suspension>
E/flutter (21416): #2      NimaActorRenderObject.filename= (package:nima/nima_actor.dart:197:11)
E/flutter (21416): #3      NimaActor.createRenderObject (package:nima/nima_actor.dart:44:9)
E/flutter (21416): #4      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4482:28)
E/flutter (21416): #5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #6      Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #8      Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
E/flutter (21416): #9      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
E/flutter (21416): #10     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
E/flutter (21416): #11     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #12     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #14     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
E/flutter (21416): #15     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
E/flutter (21416): #16     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
E/flutter (21416): #17     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4047:11)
E/flutter (21416): #18     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #19     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
E/flutter (21416): #20     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #21     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #22     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #23     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
E/flutter (21416): #24     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
E/flutter (21416): #25     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
E/flutter (21416): #26     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
E/flutter (21416): #27     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #28     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #29     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #30     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
E/flutter (21416): #31     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
E/flutter (21416): #32     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
E/flutter (21416): #33     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #35     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #36     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
E/flutter (21416): #37     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
E/flutter (21416): #38     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
E/flutter (21416): #39     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
E/flutter (21416): #40     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #41     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #42     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
E/flutter (21416): #43     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
E/flutter (21416): #44     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
E/flutter (21416): #45     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
E/flutter (21416): #46     Elemen
D/EGL_emulation(21416): eglMakeCurrent: 0xe465d040: ver 2 0 (tinfo 0xe2b53b20)
D/        (21416): HostConnection::get() New Host Connection established 0xcfdffa00, tid 21435
D/EGL_emulation(21416): eglMakeCurrent: 0xe465d1c0: ver 2 0 (tinfo 0xe2b2ae10)
E/flutter (21416): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (21416): 'dart:isolate/runtime/libtimer_impl.dart': Failed assertion: line 433: '<optimized out>': is not true.
E/flutter (21416): #0      _AssertionError._doThrowNew (dart:core/runtime/liberrors_patch.dart:40:39)
E/flutter (21416): #1      _AssertionError._throwNew (dart:core/runtime/liberrors_patch.dart:36:5)
E/flutter (21416): #2      _Timer._cancelWakeup (dart:isolate/runtime/libtimer_impl.dart:433:12)
E/flutter (21416): #3      _Timer._notifyEventHandler (dart:isolate/runtime/libtimer_impl.dart:299:7)
E/flutter (21416): #4      _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:419:5)
E/flutter (21416): #5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
mLiXin commented 5 years ago

I got the same error and this works for me:

new NimaActor( "assets/Robot.nma", alignment: Alignment.center, fit: BoxFit.contain, animation: "Flight", )

the paramater "filename" of NimaActor need add ".nma",and do not refactor "Robot.png" to "robot.png".