Coder Social home page Coder Social logo

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Thread$State java.lang.Thread.getState()' on a null object reference about barcode-reader HOT 8 OPEN

ravi8x avatar ravi8x commented on June 3, 2024
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Thread$State java.lang.Thread.getState()' on a null object reference

from barcode-reader.

Comments (8)

muhammad-farhan-bakht avatar muhammad-farhan-bakht commented on June 3, 2024 4

Hey guys I hope everyone is doing great.

Recently I have also faced this Bug and solved it. I have made the Pull Request for this bug.

In the meantime, if you want to fix it temporarily till @ravi8x merges the PR you can do the following.

  1. Download or Cloned the Library.
  2. Import this Library as a module in your Project.
  3. When completing steps 1 & 2 now go to CameraSource.java class.
  4. Remove this line assert (mProcessingThread.getState() == State.TERMINATED);

It will fix the bug.

Solution

Thanks!

from barcode-reader.

Brayan1863 avatar Brayan1863 commented on June 3, 2024 1

I recently solved this error by uploading the same repository and making the adjustment since it has not received updates for a while, you just change the name of the package and that's it

https://github.com/Brayan1863/Barcode-Reader

from barcode-reader.

nanometer34688 avatar nanometer34688 commented on June 3, 2024

@azzaxx Have you managed to fix this issue?

from barcode-reader.

Adnan-addi avatar Adnan-addi commented on June 3, 2024

having same issue in on destroy activity , any fix would help thank you

from barcode-reader.

Tahaelhosseny avatar Tahaelhosseny commented on June 3, 2024

if anyone solves it please write your solution

from barcode-reader.

KushalMehta1995 avatar KushalMehta1995 commented on June 3, 2024

have anyone solved it? please write your solution

from barcode-reader.

SagarMaher2 avatar SagarMaher2 commented on June 3, 2024

I recently solved this error by uploading the same repository and making the adjustment since it has not received updates for a while, you just change the name of the package and that's it

https://github.com/Brayan1863/Barcode-Reader

This resolve my app crash issue.

from barcode-reader.

vikas0 avatar vikas0 commented on June 3, 2024

why was the line -
assert (mProcessingThread.getState() == Thread.State.TERMINATED);
was there in the first place.

I first added a null check for mProcessingThread before the line, it fixed the crash, later i realised this line was not at all needed. As before release method is called =, stop() was already callled and mProcessingThread is actually set null.

from barcode-reader.

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.