I am scanning complex barcodes using a camera, normal PDF417 barcodes works with success however as soon as I display this barcode
I get the following errors. I am not sure how to fix it
I/Camera: handleMessage: 16
I/Camera: handleMessage: 16
E/OpenCameraSource: Exception thrown from receiver.
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at com.google.android.gms.vision.barcode.BarcodeDetector.detect(com.google.android.gms:play-services-vision@@20.1.3:27)
at com.google.android.gms.vision.Detector.receiveFrame(com.google.android.gms:play-services-vision-common@@19.1.3:11)
at com.peachss.barcodescanner.camerasource.CameraSource$FrameProcessingRunnable.run(CameraSource.java:1206)
at java.lang.Thread.run(Thread.java:919)
I/Camera: handleMessage: 16
I/Camera: handleMessage: 16
I am using the following libraries
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.camera:camera-core:1.1.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}