KingsMentor / MobileVisionBarcodeScanner

Barcode Scanner powered by Mobile Vision Api
http://belvi.xyz/posts/Mobile-Vision-Barcode-Scanner
MIT License
540 stars 109 forks source link

Error when adding in Fragment #33

Closed jpabanil closed 6 years ago

jpabanil commented 6 years ago

Hi,

I was trying to use your library in our project but got this error when I open the MainActivity that holds the fragment. I hope you can help me as soon as possible.

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.samples.vision.barcodereader.BarcodeCapture.setRetrieval(xyz.belvi.mobilevisionbarcodescanner.BarcodeRetriever)' on a null object reference at ca.easyreg.easyexhibitor.fragments.BarcodeScanner.onCreateView(BarcodeScanner.java:108)

Thanks in Advance!

J

jpabanil commented 6 years ago

This is now fixed...

kasp4770 commented 5 years ago

jpabanil how did you fix it? Do you remember?

mostafaaddam commented 4 years ago

This is still not working on fragment i tried to put barcodeCapture.setRetrieval(this); its crashing with Attempt to invoke virtual method 'void com.google.android.gms.samples.vision.barcodereader.BarcodeCapture.setRetrieval(xyz.belvi.mobilevisionbarcodescanner.BarcodeRetriever)' on a null object reference

KushalMehta1995 commented 3 years ago

Anyone got any solution regarding this? i'm too facing this problem.