GithubHelp home page GithubHelp logo

横屏扫描问题 about android-zxing HOT 8 OPEN

mylhyl avatar mylhyl commented on May 31, 2024
横屏扫描问题

from android-zxing.

Comments (8)

yangy996 avatar yangy996 commented on May 31, 2024

有个办法可以解决下,在androidmanifast中加入这条语句 android:configChanges="screenSize|keyboardHidden|orientation"
但又出现另一个问题,解锁过快,扫描界面会崩掉。。。

from android-zxing.

mylhyl avatar mylhyl commented on May 31, 2024

扫描页面生命周期是否加入

 @Override
    protected void onResume() {
        mScannerView.onResume();
        resetStatusView();
        super.onResume();
    }

    @Override
    protected void onPause() {
        mScannerView.onPause();
        super.onPause();
    }

可参考https://github.com/mylhyl/Android-Zxing/blob/master/sample/src/main/java/com/mylhyl/zxing/scanner/sample/ScannerActivity.java

from android-zxing.

mylhyl avatar mylhyl commented on May 31, 2024

贴一下崩溃log

from android-zxing.

yangy996 avatar yangy996 commented on May 31, 2024

只是扫描界面崩溃,这个日志有点看不懂
10-18 11:00:45.429 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: Late-enabling CheckJNI
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
10-18 11:00:45.539 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve interface method 17261: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve interface method 17265: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
10-18 11:00:45.549 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
10-18 11:00:45.559 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getTotalMemory ()J
10-18 11:00:45.559 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getFreeMemory ()J
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 475: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 497: Landroid/content/res/TypedArray;.getType (I)I
10-18 11:00:45.579 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 438: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample W/dalvikvm: VFY: unable to resolve virtual method 440: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
10-18 11:00:45.589 21546-21546/com.mylhyl.zxing.scanner.sample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-18 11:00:45.799 21546-21546/com.mylhyl.zxing.scanner.sample I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.2_RB1.04.04.04.154.004_msm8226_LNX.LA.3.5.2.2.2_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.15
Build Date: 08/06/14 Wed
Local Branch: mybranch4057433
Remote Branch: quic/LNX.LA.3.5.2.2.2_rb1
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.2_RB1.04.04.04.154.004 + NOTHING
10-18 11:00:45.839 21546-21546/com.mylhyl.zxing.scanner.sample D/OpenGLRenderer: Enabling debug mode 0
10-18 11:00:45.919 21546-21546/com.mylhyl.zxing.scanner.sample I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@423b84f0 time:718577

from android-zxing.

yangy996 avatar yangy996 commented on May 31, 2024

但是在zxing默认的app上面有这个错误日志
10-18 11:02:14.219 23878-24627/com.sunwayworld.zxing W/dalvikvm: threadid=18: thread exiting with uncaught exception (group=0x41769d58)
10-18 11:02:14.219 23878-24627/com.sunwayworld.zxing E/AndroidRuntime: FATAL EXCEPTION: Thread-430
Process: com.sunwayworld.zxing, PID: 23878
java.lang.IllegalArgumentException: Crop rectangle does not fit within image data.
at com.google.zxing.PlanarYUVLuminanceSource.(PlanarYUVLuminanceSource.java:50)
at com.sunwayworld.zxing.camera.CameraManager.buildLuminanceSource(CameraManager.java:346)
at com.sunwayworld.zxing.decoding.DecodeHandler.decode(DecodeHandler.java:97)
at com.sunwayworld.zxing.decoding.DecodeHandler.handleMessage(DecodeHandler.java:64)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.sunwayworld.zxing.decoding.DecodeThread.run(DecodeThread.java:123)
10-18 11:02:14.239 23878-24627/com.sunwayworld.zxing I/Process: Sending signal. PID: 23878 SIG: 9

from android-zxing.

mylhyl avatar mylhyl commented on May 31, 2024

sample没有异常,请贴出崩溃后的异常log

from android-zxing.

yangy996 avatar yangy996 commented on May 31, 2024

(横屏下)这个在我的红米手机 解锁过快的情况的才会出现(电源键锁屏后立即解锁)

from android-zxing.

yangy996 avatar yangy996 commented on May 31, 2024

找到了,这错误被覆盖了:
0-18 11:35:32.009 2312-2685/? I/octvm_klo: klo lock
10-18 11:35:32.009 26588-26846/com.mylhyl.zxing.scanner.sample E/AndroidRuntime: FATAL EXCEPTION: Thread-502
Process: com.mylhyl.zxing.scanner.sample, PID: 26588
java.lang.IllegalArgumentException: Crop rectangle does not fit within image data.
at com.google.zxing.PlanarYUVLuminanceSource.(PlanarYUVLuminanceSource.java:50)
at com.mylhyl.zxing.scanner.camera.CameraManager.buildLuminanceSource(CameraManager.java:365)
at com.mylhyl.zxing.scanner.decode.DecodeHandler.decode(DecodeHandler.java:93)
at com.mylhyl.zxing.scanner.decode.DecodeHandler.handleMessage(DecodeHandler.java:60)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.mylhyl.zxing.scanner.decode.DecodeThread.run(DecodeThread.java:134)
10-18 11:35:32.009 1168-1616/? W/ActivityManager: Force finishing activity com.mylhyl.zxing.scanner.sample/.ScannerActivity

from android-zxing.

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.