Coder Social home page Coder Social logo

NullPointerException about leonids HOT 8 OPEN

plattysoft avatar plattysoft commented on September 22, 2024
NullPointerException

from leonids.

Comments (8)

raymondctc avatar raymondctc commented on September 22, 2024 3

@smeet123 I probably figure out the reason for my case. I've been using a View.post() to force the animation to run on UI thread. I also have a destroy() call to .cancel() in ParticleSystem. It is very likely that the Runnable in my View.post() function executed after .cancel(), where mDrawingView will become null (check the code in onUpdate() and cancel()). See if that's your case too.

from leonids.

plattysoft avatar plattysoft commented on September 22, 2024

There is a lot of information missing here.
Is this a crash on the Demo app on Play Store? If so, on which example? And what are the steps to replicate. Is it 100% replicable?
I did re-check the examples right now and they seem to work fine.

If this is something you are getting on you own app, please post the code, you may be doing something wrong on the initialization of the Particle System.

from leonids.

sanjaykumarm avatar sanjaykumarm commented on September 22, 2024
  • Is this a crash on the Demo app on Play Store?
    Ans : It is on play store.
  • It is not re-producible from my end but occasionally I am getting this error on google play store console and also getting this crash log on https://www.apteligent.com/

from leonids.

plattysoft avatar plattysoft commented on September 22, 2024

That was not my question. The question was if the crash was happening on the Demos, not if your app was on the Play Store.

Without steps to replicate, there's nothing I can do.

from leonids.

raymondctc avatar raymondctc commented on September 22, 2024

I have integrated the lib into my app and I have the same issue too. Not sure what's going on and here is the stacktrace from Crashlytics

Fatal Exception: java.lang.NullPointerException
       at com.plattysoft.leonids.ParticleSystem.onUpdate(ParticleSystem.java:556)
       at com.plattysoft.leonids.ParticleSystem.access$100(ParticleSystem.java:35)
       at com.plattysoft.leonids.ParticleSystem$2.onAnimationUpdate(ParticleSystem.java:445)
       at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1251)
       at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1175)
       at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1216)
       at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:637)
       at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:660)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
       at android.view.Choreographer.doCallbacks(Choreographer.java:574)
       at android.view.Choreographer.doFrame(Choreographer.java:543)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5372)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:970)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
       at dalvik.system.NativeStart.main(NativeStart.java)

from leonids.

sanjaykumarm avatar sanjaykumarm commented on September 22, 2024

@raymondctc Thank you so much for the solution, I will check it once I get time.

from leonids.

smr99 avatar smr99 commented on September 22, 2024

May not be the cause of the reported NPE, but I can see a data race in ParticleTimerTask.run():

    if(mPs.get() != null) {
        ParticleSystem ps = mPs.get();

The two lines should be inverted:

    ParticleSystem ps = mPs.get();
    if(ps != null) {

from leonids.

renyuzhuo avatar renyuzhuo commented on September 22, 2024

The same

from leonids.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.