mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

NoSuchMethodError: The method '>' was called on null. #82

Closed NatoBoram closed 4 years ago

NatoBoram commented 5 years ago

Hello! I just upgraded my Flutter tool and now I can't use the barcode scanner anymore.

Whenever I try to scan, I have the following logs :

W/IInputConnectionWrapper(14295): finishComposingText on inactive InputConnection
I/Choreographer(14295): Skipped 58 frames!  The application may be doing too much work on its main thread.
I/flutter (14295): Unknown error : NoSuchMethodError: The method '>' was called on null.
I/flutter (14295): Receiver: null
I/flutter (14295): Tried calling: >(12)

The dependency was saved according to https://github.com/apptreesoftware/flutter_barcode_reader/issues/71#issuecomment-465299793 :

  barcode_scan:
    git: https://github.com/apptreesoftware/flutter_barcode_reader.git
NatoBoram commented 5 years ago

Turns out I didn't re-add the activity to my AndroidManifest.xml when migrating.

<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>
NatoBoram commented 5 years ago

Okay, so adding the activity makes it so I'm able to retrieve a String from the plugin, but I still have the same error as above. Previously, I only checked if I had an error and I cancelled the execution, but it turns out I have an error and the correct String.

I'll re-open it for more visibility.

devtronic commented 4 years ago

Please check #185 if it solves your problem