android-vision icon indicating copy to clipboard operation
android-vision copied to clipboard

BarcodeDetector not operational

Open jehy opened this issue 8 years ago • 10 comments
trafficstars

I have enabled google play services 10.0.84 (I check that it is available in application code) on Philips W3568 with Android 4.2.2 and BarcodeDetector can not initialize. On other phones everything is okay.

Here is my gradle:

dependencies {
    compile "com.android.support:support-v4:25.0.1"
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.google.android.gms:play-services-vision:10.0.0'//for QR codes

Here is my code:

        detector =
                new BarcodeDetector.Builder(getApplicationContext())
                        .setBarcodeFormats(Barcode.DATA_MATRIX | Barcode.QR_CODE)
                        .build();
        while (!detector.isOperational()) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

In my application section of manifest I have


        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="barcode" />

Device has free space and is connected to network.

Here is my log (it loops):

11-22 19:05:38.807 1628-1628/ru.payme.AlphaInsurance W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-22 19:05:38.812 1628-1628/ru.payme.AlphaInsurance I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-22 19:05:38.813 1628-1628/ru.payme.AlphaInsurance I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-22 19:05:38.816 1628-1628/ru.payme.AlphaInsurance W/BarcodeNativeHandle: Native handle not yet available. Reverting to no-op handle. 11-22 19:05:38.817 1628-1628/ru.payme.AlphaInsurance W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.

jehy avatar Nov 22 '16 16:11 jehy

Looks similar to #150.

pchx-zz avatar Nov 22 '16 16:11 pchx-zz

Full adb logs without any filtering:

11-23 12:42:08.405 5456-5456/ru.payme.AlphaInsurance D/ScanActivity: Checking Gogole Play services 11-23 12:42:08.412 5456-5456/ru.payme.AlphaInsurance D/ScanActivity: Building BarcodeDetector 11-23 12:42:08.415 5456-5456/ru.payme.AlphaInsurance W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 12:42:08.416 492-1899/? D/ActivityManager: getContentProviderImpl: name=com.google.android.gms.chimera, userId=0 11-23 12:42:08.416 492-1899/? I/ProviderMap: getProviderByName: com.google.android.gms.chimera , callingUid = 10081 11-23 12:42:08.416 492-1899/? D/ActivityManager: getContentProviderImpl: Caller Process Info:(caller= [email protected]=10081r.userId=0r.processName=ru.payme.AlphaInsurance) 11-23 12:42:08.416 492-1899/? D/ActivityManager: getContentProviderImpl: ContentProviderRecord cpr:(, cpr.uid=10014, cpr.name=ComponentInfo{com.google.android.gms/com.google.android.gms.chimera.container.ModuleProvider}, cpr.noReleaseNeeded=false) Provider Info:(, cpi.authority=com.google.android.gms.chimera, cpi.multiprocess=false, cpi.readPermission=null, cpi.readPermission=null) Provider App Info:(, cpr.appInfo=com.google.android.gms.chimera, cpi.multiprocess=false, cpi.readPermission=null, cpi.readPermission=null) 11-23 12:42:08.416 492-1899/? W/ContentProviderRecord: canRunHere: bCanRunHere=falseinfo.multiprocess=falseinfo.processName=com.google.android.gmsapp.processName=ru.payme.AlphaInsuranceuid=10014app.info.uid10081 11-23 12:42:08.417 492-1899/? D/ActivityManager: getContentProviderImpl: updateLruProcessLocked cpr.proc=ProcessRecord{420fa8d8 13279:com.google.android.gms/u0a10014} 11-23 12:42:08.421 5456-5456/ru.payme.AlphaInsurance D/ActivityThread: installProvider: context=android.app.ContextImpl@41904628holder=android.app.IActivityManager$ContentProviderHolder@41b777e0noisy=truenoReleaseNeeded=falsestable=false 11-23 12:42:08.428 13279-15709/? D/IPCThreadState: [DN #5] BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x56231768 11-23 12:42:08.429 5456-5456/ru.payme.AlphaInsurance I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 12:42:08.429 5456-5456/ru.payme.AlphaInsurance I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 12:42:08.433 159-159/? W/ADB_SERVICES: create_local_service_socket() name=shell:cat /proc/net/xt_qtaguid/stats | grep 10081 11-23 12:42:08.434 159-159/? W/ADB_SERVICES: LS(60782): bound to 'shell:cat /proc/net/xt_qtaguid/stats | grep 10081' via 18 11-23 12:42:08.434 7064-7064/? W/ADB_SERVICES: adb: unable to open /proc/7064/oom_adj 11-23 12:42:08.449 159-159/? D/ADB_SERVICES: closing because is_eof=1 r=-1 s->fde.force_eof=0 11-23 12:42:08.449 159-159/? W/ADB_SERVICES: entered. LS(60782) fd=18 11-23 12:42:08.455 5456-5456/ru.payme.AlphaInsurance W/BarcodeNativeHandle: Native handle not yet available. Reverting to no-op handle. 11-23 12:42:08.456 5456-5456/ru.payme.AlphaInsurance D/ScanActivity: Checking BarcodeDetector 11-23 12:42:08.457 5456-5456/ru.payme.AlphaInsurance W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 12:42:08.462 13279-13290/? D/IPCThreadState: [DN #5] BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x57160480 11-23 12:42:08.463 5456-5456/ru.payme.AlphaInsurance I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 12:42:08.463 5456-5456/ru.payme.AlphaInsurance I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 12:42:08.466 5456-5456/ru.payme.AlphaInsurance E/ScanActivity: Could not set up the BarcodeDetector!

I think that something can be wrong with updateLruProcessLocked

jehy avatar Nov 23 '16 09:11 jehy

Tried sample application - same results:

11-23 13:04:06.701 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 13:04:06.702 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 13:04:06.702 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 13:04:06.712 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 13:04:06.713 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 13:04:06.714 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 13:04:06.717 11383-11483/com.google.android.gms.samples.vision.barcodereader D/Camera-JNI: Adding callback buffer to queue, 4 total 11-23 13:04:06.783 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: processIncoming 11-23 13:04:06.783 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: handlePacket : cmd=0x1, cmdSet=0xC7, len=0x14, id=0x400071F8, flags=0x0, dataLen=0x9 11-23 13:04:06.784 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: sendBufferedRequest : len=0x34 11-23 13:04:06.786 11383-11395/com.google.android.gms.samples.vision.barcodereader D/Camera-JNI: Using callback buffer from queue of length 4 11-23 13:04:06.797 11383-11383/com.google.android.gms.samples.vision.barcodereader I/Camera: handleMessage: 16 11-23 13:04:06.798 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 13:04:06.802 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 13:04:06.804 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 13:04:06.807 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.

jehy avatar Nov 23 '16 10:11 jehy

Sample application logs without filters:

11-23 13:06:38.138 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. 11-23 13:06:38.143 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801 11-23 13:06:38.146 11383-11483/com.google.android.gms.samples.vision.barcodereader I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801 11-23 13:06:38.147 159-159/? D/ADB_SERVICES: closing because is_eof=1 r=-1 s->fde.force_eof=0 11-23 13:06:38.147 159-159/? W/ADB_SERVICES: entered. LS(64103) fd=18 11-23 13:06:38.150 11383-11483/com.google.android.gms.samples.vision.barcodereader D/Camera-JNI: Adding callback buffer to queue, 4 total 11-23 13:06:38.207 136-11480/? D/MtkCam/VSSScen: [deque] P1:Idx(0),Id(64),VA(0x44404000),PA(0x00640000),S(1548384),T(96396.099583) 11-23 13:06:38.207 136-11480/? D/MtkCam/MtkCamUtils: (RecCB@ImgBufQue)[dequeProvider] Empty Que 11-23 13:06:38.207 136-11480/? D/MtkCam/PrvCQT: (11480)[updateOne] P2(0x18) 11-23 13:06:38.207 136-11480/? D/MtkCam/PrvCQT: (11480)[doCrop] S(1016/762),D(1024/768),Z(100),C(0,0,1016,762) 11-23 13:06:38.207 136-11480/? I/iio/ppp: [configPipe] vInPorts:[0]:(0x100),w(1016),h(762),stride(1016,0,0),type(0),idx(2),dir(0) 11-23 13:06:38.207 136-11480/? I/iio/ppp: [configPipe] vOutPorts:[0]:(0x8),w(1024),h(768),stride(1024,512,512),type(5),idx(20),dir(1) 11-23 13:06:38.208 136-11480/? I/iio/ppp: [configPipe] vOutPorts:[1]:(0x10),w(1024),h(768),stride(1024,1024,0),type(4),idx(21),dir(1) 11-23 13:06:38.208 136-11480/? I/iio/ppp: [configPipe] config imgi[1016, 762] imgiCrop_f(0x0, 0x0)[0, 0, 1016, 762] 11-23 13:06:38.208 136-11480/? D/MtkCam/VSSScen: [deque] + 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufImgi: memID=64, u4BufPA=0x640000, u4BufVA=0x44404000 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufImgi: has mva address (use mva) 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufDispo: memID=77, u4BufPA=0x0, u4BufVA=0x44ab6000 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufDispo: no mva address, but has ion id (use ion) 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufVido: memID=-1, u4BufPA=0x441c4000, u4BufVA=0x441c4000 11-23 13:06:38.208 136-11480/? I/iio/ppp: [start] m_vBufVido: no ion id, va & mva address the same (use va) 11-23 13:06:38.209 136-11484/? D/MDP: DpMmu: MVA = 0x640000 (VA = 0x44404000), size = 1548384, engine = 3, plane = 0 11-23 13:06:38.209 136-11484/? D/MDP: DpIon: MVA = 0xfc0000 (shareFD = 77), size = 1179648, engine = 9, type = 0 11-23 13:06:38.209 136-11484/? D/MDP: DpIon: MVA = 0xfc0000 (shareFD = 77), size = 1179648, engine = 9, type = 1 11-23 13:06:38.209 136-11484/? D/MDP: DpIon: MVA = 0xfc0000 (shareFD = 77), size = 1179648, engine = 9, type = 2 11-23 13:06:38.209 136-11484/? I/M4U_L: ioctl MTK_M4U_T_ALLOC_MVA! VA:0x44284000, MVA:0x1100000 11-23 13:06:38.209 136-11484/? D/MDP: DpMmu: MVA = 0x1100000 (VA = 0x44284000), size = 393216, engine = 8, plane = 1 11-23 13:06:38.210 136-11484/? I/M4U_L: ioctl MTK_M4U_T_ALLOC_MVA! VA:0x441c4000, MVA:0x1180000 11-23 13:06:38.210 136-11484/? D/MDP: DpMmu: MVA = 0x1180000 (VA = 0x441c4000), size = 786432, engine = 8, plane = 0 11-23 13:06:38.210 136-11484/? D/MDP: DpDriver: exec command block: start 0x4353dac8, end 0x4353f0b8 Engine Flag [368] 11-23 13:06:38.213 136-11484/? D/MDP: DpDriver: exec command block end: start 0x4353dac8, end 0x4353f0b8 Engine Flag [368] 11-23 13:06:38.213 136-11480/? D/MtkCam/VSSScen: [deque] P2DISPO:Id(77),VA(0x44AB6000),PA(0x00000000),S(1179648),T(0.000000) 11-23 13:06:38.213 136-11480/? D/MtkCam/VSSScen: [deque] P2VIDO:Id(-1),VA(0x441C4000),PA(0x441C4000),S(1179648),T(0.000000) 11-23 13:06:38.214 136-11479/? D/MtkCam/DisplayClient: (11479)[handleReturnBuffers] + (101) 34ms < Duration(101) 11-23 13:06:38.214 136-11479/? D/MtkCam/DisplayClient: (11479)[handleReturnBuffers] Show display frame:0(1) [fdIon(77) 0x44ab6000/1179648 96396099583000] 11-23 13:06:38.214 136-11479/? W/SurfaceTextureClient: [STC::queueBuffer(Camera)] this:0x41af7c68, api:4, abnormal interval:101.75 11-23 13:06:38.214 136-11479/? D/MtkCam/DisplayClient: (11479)[handleReturnBuffers] - 11-23 13:06:38.214 136-11479/? D/MtkCam/MtkCamUtils: [queryImgBufferSize] [yv12-gpu] 1024x768 image buffer size: 1179648 11-23 13:06:38.214 136-11479/? D/MtkCam/DisplayClient: (11479)[waitAndHandleReturnBuffers] + 11-23 13:06:38.214 136-11480/? I/MtkCam/MtkCamUtils: {CamProfile}[::updateOne] : (0-th) ===> [start-->now: 101 ms] 11-23 13:06:38.214 136-11480/? D/MtkCam/PrvCQT: (11480)[update] frameCnt(2254) 11-23 13:06:38.214 136-11480/? D/MtkCam/VSSScen: [deque] + 11-23 13:06:38.214 136-11477/? D/MtkCam/PrvCB: (11477)[handleReturnBuffers] + 34ms<Duration(101) 34ms<Duration(101) 11-23 13:06:38.214 136-11477/? D/MtkCam/PrvCB: (11477)[handleReturnBuffers] callback:0(1) [0x441c4000/1179648 0xf745fc18] CookieDE:0x57ab 11-23 13:06:38.218 136-11477/? D/MtkCam/PrvCB: (11477)[handleReturnBuffers] - 11-23 13:06:38.218 136-11477/? D/MtkCam/PrvCB: (11477)[waitAndHandleReturnBuffers] + 11-23 13:06:38.220 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: processIncoming 11-23 13:06:38.221 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: handlePacket : cmd=0x1, cmdSet=0xC7, len=0x14, id=0x40007325, flags=0x0, dataLen=0x9 11-23 13:06:38.221 11383-11390/com.google.android.gms.samples.vision.barcodereader D/jdwp: sendBufferedRequest : len=0x34 11-23 13:06:38.222 11383-11439/com.google.android.gms.samples.vision.barcodereader D/Camera-JNI: Using callback buffer from queue of length 4 11-23 13:06:38.227 11383-11383/com.google.android.gms.samples.vision.barcodereader I/Camera: handleMessage: 16 11-23 13:06:38.228 11383-11483/com.google.android.gms.samples.vision.barcodereader W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.

jehy avatar Nov 23 '16 10:11 jehy

Oops, I detected that I have low storage space. But that's not the only reason. I tried to detect low storage space using code from #20:

// Check for low storage.  If there is low storage, the native library will not be
       // downloaded, so detection will not become operational.
       IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);
       boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;

       if (hasLowStorage) {
           Toast.makeText(this, R.string.low_storage_error, Toast.LENGTH_LONG).show();
           Log.w(TAG, getString(R.string.low_storage_error));
       }

And it does not display anything. Also, sample apps did not show me the warning. I suppose that the real reason for error is that there are pending downloads in google play (those failed to update because of low storage space and are pending) - that's why we get updateLruProcessLocked and don't get Intent.ACTION_DEVICE_STORAGE_LOW.

It would be good if we could get the reason why BarcodeDetector is not operational.

jehy avatar Nov 23 '16 11:11 jehy

UPD. Nope, the problem was only in free space. After cleaning up, everything began to work as expected. I used gist https://gist.github.com/mitchross/b012bd72a9cd3b1f92c7 from issue #45 as a workaround but that was damn unfriendly and wasted two days of my attempts :(

jehy avatar Nov 23 '16 12:11 jehy

In my case, Clear Data of Google Play Service solved the problem

kruyvanna avatar Jul 10 '17 02:07 kruyvanna

I have tried many solution , but Clearing cache and data from download manager and google play services was the only thing that worked after 4 hours .

Mosta-777 avatar Apr 04 '18 15:04 Mosta-777

How to implement a Qr Code reading interval in seconds?

jccalbuquerque avatar Apr 16 '18 18:04 jccalbuquerque

My always work solution has been to update google play services, then delete the failing app, then restart the device then reinstall the app. It even works to beta versions, get them from here: https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=google+play+services And don't forget to disable google play services automatic updates or it will break your app again, and google complains about android versions fragmentation... For some reason manual APK updates do not break it.

grillermo avatar May 08 '19 16:05 grillermo