nisrulz / qreader

:white_square_button: [Android Library] Read QR codes using google's mobile vision api, but without the hassle
http://nisrulz.github.io/qreader
Apache License 2.0
369 stars 108 forks source link

Detector processor must first be set #17

Closed abbasalim closed 7 years ago

abbasalim commented 8 years ago

E/CameraSource: Exception thrown from receiver. java.lang.IllegalStateException: Detector processor must first be set with setProcessor in order to receive detection results. at com.google.android.gms.vision.Detector.receiveFrame(Unknown Source) at com.google.android.gms.vision.CameraSource$zzb.run(Unknown Source) at java.lang.Thread.run(Thread.java:818)

i use your sample code exactly, but recive this error

nisrulz commented 8 years ago

@abbasalim please provide your device details, os version and steps to reproduce this issue.

abbasalim commented 8 years ago

i tested this in my galaxy j7 device with android 5.1

nisrulz commented 8 years ago

The app runs perfectly fine for me. @abbasalim please provide steps to reproduce this issue.

abbasalim commented 8 years ago

i used this code:

qrEader = new QREader.Builder(this, surfaceView, new QRDataListener() {
            @Override public void onDetected(final String data) {
                Log.d("QREader", "Value : " + data);
                textView_qrcode_info.post(new Runnable() {
                    @Override public void run() {
                        textView_qrcode_info.setText(data);
                    }
                });
            }
        }).facing(QREader.BACK_CAM)
                .enableAutofocus(true)
                .height(800)
                .width(1100)
                .build();

        qrEader.init();
//////
@Override protected void onStart() {
        super.onStart();

        // Call in onStart
        qrEader.start();
    }

    @Override protected void onDestroy() {
        super.onDestroy();

        // Call in onDestroy
        qrEader.stop();
        qrEader.releaseAndCleanup();
    }

in my Activity

nisrulz commented 8 years ago

Do you have surface view in the layout and referenced in code as below ? surfaceView = (SurfaceView) findViewById(R.id.camera_view);

abbasalim commented 8 years ago

capture

nisrulz commented 8 years ago

Everything looks fine to me. Are you using Instant Run ? Can you confirm uninstalling the app and reinstalling it without Instant run helps you or not ?

abbasalim commented 8 years ago

i also tested in lg g2 with android 5.0 but :| Exception thrown from receiver. java.lang.IllegalStateException: Detector processor must first be set with setProcessor in order to receive detection results. at com.google.android.gms.vision.Detector.receiveFrame(Unknown Source) at com.google.android.gms.vision.CameraSource$zzb.run(Unknown Source) at java.lang.Thread.run(Thread.java:818)

nisrulz commented 8 years ago

Let me do some more testing and I will update you soon.

nisrulz commented 7 years ago

@abbasalim Already merged the fix into develop as provided by @punksta , hence closing this issue. Reopen if it persists.