Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running example given #5

Open
KaranChimple opened this issue Nov 23, 2018 · 3 comments
Open

Error while running example given #5

KaranChimple opened this issue Nov 23, 2018 · 3 comments

Comments

@KaranChimple
Copy link

The following is the error that I received while running the example app. Kindly have a look at this:

I/flutter (22356): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (22356): The following assertion was thrown during a scheduler callback:
I/flutter (22356): setState() called after dispose(): WelcomeScreenState#1f5f4(lifecycle state: defunct, not mounted)
I/flutter (22356): This error happens if you call setState() on a State object for a widget that no longer appears in
I/flutter (22356): the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
I/flutter (22356): can occur when code calls setState() from a timer or an animation callback. The preferred solution
I/flutter (22356): is to cancel the timer or stop listening to the animation in the dispose() callback. Another
I/flutter (22356): solution is to check the "mounted" property of this object before calling setState() to ensure the
I/flutter (22356): object is still in the tree.
I/flutter (22356): This error might indicate a memory leak if setState() is being called because another object is
I/flutter (22356): retaining a reference to this State object after it has been removed from the tree. To avoid memory
I/flutter (22356): leaks, consider breaking the reference to this object during dispose().

I tried resolving this to some extent using the mounted property of the Widget build however, it still throws the following error:
I/flutter (22356): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (22356): The following NoSuchMethodError was thrown during a scheduler callback:
I/flutter (22356): The getter 'isLooping' was called on null.
I/flutter (22356): Receiver: null
I/flutter (22356): Tried calling: isLooping

@luigi-rosso
Copy link
Contributor

Hello Karan, could you use update to the latest version of the package and let me know if you still see the problem? If so, how did you get the error, was it after a hot reload or just on a fresh start?

@AxelRocha
Copy link

AxelRocha commented Nov 18, 2019

I just faced this problem and solved it.

To solve it, you should change the animatation parameter to one that is implemented by your actor.

Example: I'm currently using this one: https://www.2dimensions.com/a/castor/files/nima/robot
If I put animation: "idle" when calling NimaActor, "isLooping was called on Null" is thrown.
You must put in the animation parameter the animations that your nime can use, in my case is "Flight"

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

@AxelRocha
Copy link

Another way to "solve it" is to change the package.

In the nima_actor.dart, the error is thrown in the 295th - 305 line, so wrap it with an If statement.
if(layer.animation !=null) then do the lines 295-305.

Of course I wouldn't recommend doing it. It would be a good thing if the package's devoleper team fix this @luigi-rosso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants