Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I fix this problem? error: package android.support.v4.app dosen't exit. #45

Closed
pangpangshui opened this issue Sep 1, 2017 · 12 comments

Comments

@pangpangshui
Copy link

pangpangshui commented Sep 1, 2017

@ftylitak My platform system is Android.please give me a hand

@ftylitak
Copy link
Owner

ftylitak commented Sep 1, 2017

Hello @zjq19930322

i will need more information in order to help you.

Have you setup the project to use "gradle" instead of "ant"? (here is the location of this setting: #34 (comment))

Can you provide me with some logs?

Best regards

@pangpangshui
Copy link
Author

What is the different between "ant" and "gradle"? Actually I am developing my project in Android which is also use the qzxing lib to decode the QRcode. It is normal when I install my project to Android 5.1, but it dosen't work in Android 6.0 because it can't call the camera. I'm trying to find the solution. It may be the reason that I should apply permission dynamically after Android 6.0. May I ask for your help?

@ftylitak
Copy link
Owner

ftylitak commented Sep 1, 2017

Ant and gradle are different tools for building Android apps. Just always use "gradle" (follow the steps from my previous comment).

Moreover, for the permissions i would suggest you first look at QZXingLive example at the following:

Modify and embed these to your code and it should work. In case you face any issue, you are free to contact back and i will try to find some time to take a look at it.

@ekke
Copy link

ekke commented Sep 1, 2017 via email

@pangpangshui
Copy link
Author

pangpangshui commented Sep 1, 2017

Thanks a lot. I will have a try. Oh, I fogot to tell you that I have built QZXingLive project in Android 6.0 using "ant". But It crash. I have no idea why this happened. The debug info like this:

I art     : backtrace->Unwind begin : 29900
I art     : backtrace->Unwind end : 29900
E art     : JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat;
E art     :   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
E art     :   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
E art     : Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/org.ftylitak.qzxing-1/base.apk"],nativeLibraryDirectories=[/data/app/org.ftylitak.qzxing-1/lib/arm, /data/app/org.ftylitak.qzxing-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
E art     :   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
E art     :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
E art     :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
E art     :   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
E art     :   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
E art     :     in call to NewGlobalRef
E art     : "QtThread" prio=5 tid=12 Runnable
E art     :   | group="main" sCount=0 dsCount=0 obj=0x12cb6160 self=0xee6d0800
E art     :   | sysTid=29900 nice=0 cgrp=default sched=0/0 handle=0xdd23f930
E art     :   | state=R schedstat=( 40413539 331461 23 ) utm=4 stm=0 core=8 HZ=100
E art     :   | stack=0xdd143000-0xdd145000 stackSize=1014KB
E art     :   | held mutexes= "mutator lock"(shared held)
E art     :   native: #00 pc 0034cc09  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+204)
E art     :   native: #01 pc 0032db67  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+146)
E art     :   native: #02 pc 00240e57  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+902)
E art     :   native: #03 pc 002414eb  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
E art     :   native: #04 pc 000edd9d  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28)
E art     :   native: #05 pc 000f2ba3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+4894)
E art     :   native: #06 pc 001040b9  /system/lib/libart.so (_ZN3art8CheckJNI12NewGlobalRefEP7_JNIEnvP8_jobject+368)
E art     :   native: #07 pc 0014c917  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivateC1EP8_jobject+68)
E art     :   native: #08 pc 0014dbaf  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (???)
E art     :   native: #09 pc 00150693  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivate20getStaticObjectFieldEPKcS1_S1_+66)
E art     :   native: #10 pc 0001add9  /data/data/org.ftylitak.qzxing/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
E art     :   (no managed stack frames)
F art     : art/runtime/java_vm_ext.cc:440] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat;
F art     : art/runtime/java_vm_ext.cc:440]   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
F art     : art/runtime/java_vm_ext.cc:440]   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
F art     : art/runtime/java_vm_ext.cc:440] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/org.ftylitak.qzxing-1/base.apk"],nativeLibraryDirectories=[/data/app/org.ftylitak.qzxing-1/lib/arm, /data/app/org.ftylitak.qzxing-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
F art     : art/runtime/java_vm_ext.cc:440]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
F art     : art/runtime/java_vm_ext.cc:440]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
F art     : art/runtime/java_vm_ext.cc:440]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
F art     : art/runtime/java_vm_ext.cc:440]   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
F art     : art/runtime/java_vm_ext.cc:440]   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
F art     : art/runtime/java_vm_ext.cc:440]
F art     : art/runtime/java_vm_ext.cc:440]     in call to NewGlobalRef
F art     : art/runtime/java_vm_ext.cc:440] "QtThread" prio=5 tid=12 Runnable
F art     : art/runtime/java_vm_ext.cc:440]   | group="main" sCount=0 dsCount=0 obj=0x12cb6160 self=0xee6d0800
F art     : art/runtime/java_vm_ext.cc:440]   | sysTid=29900 nice=0 cgrp=default sched=0/0 handle=0xdd23f930
F art     : art/runtime/java_vm_ext.cc:440]   | state=R schedstat=( 40413539 331461 23 ) utm=4 stm=0 core=8 HZ=100
F art     : art/runtime/java_vm_ext.cc:440]   | stack=0xdd143000-0xdd145000 stackSize=1014KB
F art     : art/runtime/java_vm_ext.cc:440]   | held mutexes= "mutator lock"(shared held)
F art     : art/runtime/java_vm_ext.cc:440]   native: #00 pc 0034cc09  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+204)
F art     : art/runtime/java_vm_ext.cc:440]   native: #01 pc 0032db67  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+146)
F art     : art/runtime/java_vm_ext.cc:440]   native: #02 pc 00240e57  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+902)
F art     : art/runtime/java_vm_ext.cc:440]   native: #03 pc 002414eb  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
F art     : art/runtime/java_vm_ext.cc:440]   native: #04 pc 000edd9d  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28)
F art     : art/runtime/java_vm_ext.cc:440]   native: #05 pc 000f2ba3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+4894)
F art     : art/runtime/java_vm_ext.cc:440]   native: #06 pc 001040b9  /system/lib/libart.so (_ZN3art8CheckJNI12NewGlobalRefEP7_JNIEnvP8_jobject+368)
F art     : art/runtime/java_vm_ext.cc:440]   native: #07 pc 0014c917  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivateC1EP8_jobject+68)
F art     : art/runtime/java_vm_ext.cc:440]   native: #08 pc 0014dbaf  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (???)
F art     : art/runtime/java_vm_ext.cc:440]   native: #09 pc 00150693  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivate20getStaticObjectFieldEPKcS1_S1_+66)
F art     : art/runtime/java_vm_ext.cc:440]   native: #10 pc 0001add9  /data/data/org.ftylitak.qzxing/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F art     : art/runtime/java_vm_ext.cc:440]   (no managed stack frames)
F art     : art/runtime/java_vm_ext.cc:440]
I art     : backtrace->Unwind begin : 29900
I art     : backtrace->Unwind end : 29900
I art     : backtrace->Unwind begin : 29900
I art     : backtrace->Unwind end : 29900
I art     : backtrace->Unwind begin : 29794
I art     : backtrace->Unwind end : 29794
I art     : backtrace->Unwind begin : 29799
I art     : backtrace->Unwind end : 29799
I art     : backtrace->Unwind begin : 29801
I art     : backtrace->Unwind end : 29801
I art     : backtrace->Unwind begin : 29802
I art     : backtrace->Unwind end : 29802
I art     : backtrace->Unwind begin : 29803
I art     : backtrace->Unwind end : 29803
I art     : backtrace->Unwind begin : 29804
I art     : backtrace->Unwind end : 29804
I art     : backtrace->Unwind begin : 29805
I art     : backtrace->Unwind end : 29805
I art     : backtrace->Unwind begin : 29806
I art     : backtrace->Unwind end : 29806
I art     : backtrace->Unwind begin : 29807
I art     : backtrace->Unwind end : 29807
I art     : backtrace->Unwind begin : 29808
I art     : backtrace->Unwind end : 29808
I art     : backtrace->Unwind begin : 29882
I art     : backtrace->Unwind end : 29882
I art     : backtrace->Unwind begin : 29904
I art     : backtrace->Unwind end : 29904
F art     : art/runtime/runtime.cc:415] Runtime aborting...
F art     : art/runtime/runtime.cc:415] Aborting thread:
F art     : art/runtime/runtime.cc:415] "QtThread" prio=5 tid=12 Native
F art     : art/runtime/runtime.cc:415]   | group="" sCount=0 dsCount=0 obj=0x12cb6160 self=0xee6d0800
F art     : art/runtime/runtime.cc:415]   | sysTid=29900 nice=0 cgrp=default sched=0/0 handle=0xdd23f930
F art     : art/runtime/runtime.cc:415]   | state=R schedstat=( 49964385 331461 30 ) utm=4 stm=0 core=8 HZ=100
F art     : art/runtime/runtime.cc:415]   | stack=0xdd143000-0xdd145000 stackSize=1014KB
F art     : art/runtime/runtime.cc:415]   | held mutexes= "abort lock"
F art     : art/runtime/runtime.cc:415]   native: #00 pc 0034cc09  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+204)
F art     : art/runtime/runtime.cc:415]   native: #01 pc 0032db67  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+146)
F art     : art/runtime/runtime.cc:415]   native: #02 pc 00311827  /system/lib/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+22)
F art     : art/runtime/runtime.cc:415]   native: #03 pc 00311aa7  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+542)
F art     : art/runtime/runtime.cc:415]   native: #04 pc 000e5a89  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2092)
F art     : art/runtime/runtime.cc:415]   native: #05 pc 00241169  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1688)
F art     : art/runtime/runtime.cc:415]   native: #06 pc 002414eb  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
F art     : art/runtime/runtime.cc:415]   native: #07 pc 000edd9d  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28)
F art     : art/runtime/runtime.cc:415]   native: #08 pc 000f2ba3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+4894)
F art     : art/runtime/runtime.cc:415]   native: #09 pc 001040b9  /system/lib/libart.so (_ZN3art8CheckJNI12NewGlobalRefEP7_JNIEnvP8_jobject+368)
F art     : art/runtime/runtime.cc:415]   native: #10 pc 0014c917  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivateC1EP8_jobject+68)
F art     : art/runtime/runtime.cc:415]   native: #11 pc 0014dbaf  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (???)
F art     : art/runtime/runtime.cc:415]   native: #12 pc 00150693  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivate20getStaticObjectFieldEPKcS1_S1_+66)
F art     : art/runtime/runtime.cc:415]   native: #13 pc 0001add9  /data/data/org.ftylitak.qzxing/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F art     : art/runtime/runtime.cc:415]   (no managed stack frames)
F art     : art/runtime/runtime.cc:415] Pending exception java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat;
F art     : art/runtime/runtime.cc:415]   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
F art     : art/runtime/runtime.cc:415]   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
F art     : art/runtime/runtime.cc:415] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/org.ftylitak.qzxing-1/base.apk"],nativeLibraryDirectories=[/data/app/org.ftylitak.qzxing-1/lib/arm, /data/app/org.ftylitak.qzxing-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
F art     : art/runtime/runtime.cc:415]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
F art     : art/runtime/runtime.cc:415]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
F art     : art/runtime/runtime.cc:415]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
F art     : art/runtime/runtime.cc:415]   at void org.ftylitak.qzxing.Utilities.checkAndRequestPermissionList(android.app.Activity, java.lang.String[]) (Utilities.java:24)
F art     : art/runtime/runtime.cc:415]   at void org.ftylitak.qzxing.Utilities.requestQZXingPermissions(android.app.Activity) (Utilities.java:38)
F art     : art/runtime/runtime.cc:415] Dumping all threads without appropriate locks held: thread list lock mutator lock
F art     : art/runtime/runtime.cc:415] All threads:
F art     : art/runtime/runtime.cc:415] DALVIK THREADS (13):
F art     : art/runtime/runtime.cc:415] "QtThread" prio=5 tid=12 Runnable
F art     : art/runtime/runtime.cc:415]   | group="" sCount=0 dsCount=0 obj=0x12cb6160 self=0xee6d0800
F art     : art/runtime/runtime.cc:415]   | sysTid=29900 nice=0 cgrp=default sched=0/0 handle=0xdd23f930
F art     : art/runtime/runtime.cc:415]   | state=R schedstat=( 65813385 1664307 32 ) utm=5 stm=1 core=8 HZ=100
F art     : art/runtime/runtime.cc:415]   | stack=0xdd143000-0xdd145000 stackSize=1014KB
F art     : art/runtime/runtime.cc:415]   | held mutexes= "abort lock" "mutator lock"(shared held)
F art     : art/runtime/runtime.cc:415]   native: #00 pc 0034cc09  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+204)
F art     : art/runtime/runtime.cc:415]   native: #01 pc 0032db67  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+146)
F art     : art/runtime/runtime.cc:415]   native: #02 pc 00337381  /system/lib/libart.so (_ZN3art14DumpCheckpoint3RunEPNS_6ThreadE+432)
F art     : art/runtime/runtime.cc:415]   native: #03 pc 00337ee1  /system/lib/libart.so (_ZN3art10ThreadList13RunCheckpointEPNS_7ClosureE+200)
F art     : art/runtime/runtime.cc:415]   native: #04 pc 00338437  /system/lib/libart.so (_ZN3art10ThreadList4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138)
F art     : art/runtime/runtime.cc:415]   native: #05 pc 00311a1b  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+402)
F art     : art/runtime/runtime.cc:415]   native: #06 pc 000e5a89  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2092)
F art     : art/runtime/runtime.cc:415]   native: #07 pc 00241169  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1688)
F art     : art/runtime/runtime.cc:415]   native: #08 pc 002414eb  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
F art     : art/runtime/runtime.cc:415]   native: #09 pc 000edd9d  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28)
F art     : art/runtime/runtime.cc:415]   native: #10 pc 000f2ba3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+4894)
F art     : art/runtime/runtime.cc:415]   native: #11 pc 001040b9  /system/lib/libart.so (_ZN3art8CheckJNI12NewGlobalRefEP7_JNIEnvP8_jobject+368)
F art     : art/runtime/runtime.cc:415]   native: #12 pc 0014c917  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivateC1EP8_jobject+68)
F art     : art/runtime/runtime.cc:415]   native: #13 pc 0014dbaf  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (???)
F art     : art/runtime/runtime.cc:415]   native: #14 pc 00150693  /data/app/org.ftylitak.qzxing-1/lib/arm/libQt5Core.so (_ZN17QJNIObjectPrivate20getStaticObjectFieldEPKcS1_S1_+66)
F art     : art/runtime/runtime.cc:415]   native: #15 pc 0001add9  /data/data/org.ftylitak.qzxing/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F art     : art/runtime/runtime.cc:415]   (no managed stack frames)
F art     : art/runtime/runtime.cc:415]
F art     : art/runtime/runtime.cc:415] "main" prio=5 tid=1 Native
F art     : art/runtime/runtime.cc:415]   | group="" sCount=1 dsCount=0 obj=0x758452a0 self=0xf4836a00
F art     : art/runtime/runtime.cc:415]   | sysTid=29794 nice=0 cgrp=default sched=0/0 handle=0xf722ede4
F art     : art/runtime/runtime.cc:415]   | state=S schedstat=( 1176169998 11434388 267 ) utm=96 stm=21 core=5 HZ=100
F art     : art/runtime/runtime.cc:415]   | stack=0xff4af000-0xff4b1000 stackSize=8MB
F art     : art/runtime/runtime.cc:415]   | held mutexes=
F art     : art/runtime/runtime.cc:415]   kernel: __switch_to+0x74/0x8c
F art     : art/runtime/runtime.cc:415]   kernel: SyS_epoll_wait+0x340/0x4b0
F art     : art/runtime/runtime.cc:415]   kernel: compat_SyS_epoll_pwait+0x114/0x120
F art     : art/runtime/runtime.cc:415]   kernel: el0_svc_naked+0x20/0x28
F art     : art/runtime/runtime.cc:415]   native: #00 pc 00041bf0  /system/lib/libc.so (__epoll_pwait+20)
F art     : art/runtime/runtime.cc:415]   native: #01 pc 0001a37b  /system/lib/libc.so (epoll_pwait+26)
F art     : art/runtime/runtime.cc:415]   native: #02 pc 0001a389  /system/lib/libc.so (epoll_wait+6)
F art     : art/runtime/runtime.cc:415]   native: #03 pc 00012bfb  /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+102)
F art     : art/runtime/runtime.cc:415]   native: #04 pc 00012e7b  /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+130)
F art     : art/runtime/runtime.cc:415]   native: #05 pc 00077c49  /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
F art     : art/runtime/runtime.cc:415]   native: #06 pc 00000575  /system/framework/arm/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
F art     : art/runtime/runtime.cc:415]   at android.os.MessageQueue.nativePollOnce(Native method)
F art     : art/runtime/runtime.cc:415]   at android.os.MessageQueue.next(MessageQueue.java:328)
F art     : art/runtime/runtime.cc:415]   at android.os.Looper.loop(Looper.java:164)
F art     : art/runtime/runtime.cc:415]   at android.app.ActivityThread.main(ActivityThread.java:5791)
F art     : art/runtime/runtime.cc:415]   at java.lang.reflect.Method.invoke!(Native method)
F art     : art/runtime/runtime.cc:415]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
F art     : art/runtime/runtime.cc:415]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
F art     : art/runtime/runtime.cc:415]
F art     : art/runtime/runtime.cc:415] "Signal Catcher" prio=5 tid=2 WaitingInMainSignalCatcherLoop
F art     : art/runtime/runtime.cc:415]   | group="" sCount=1 dsCount=0 obj=0x12c0e0a0 self=0xee6ce000
F art     : art/runtime/runtime.cc:415]   | sysTid=29799 nice=0 cgrp=default sched=0/0 handle=0xf3f17930
F art     : art/runtime/runtime.cc:415]   | state=S schedstat=( 1369385 32461 2 ) utm=0 stm=0 core=7 HZ=100
F art     : art/runtime/runtime.cc:415]   | stack=0xf3e1b000-0xf3e1d000 stackSize=1014KB
F art     : art/runtime/runtime.cc:415]   | held mutexes=
F art     : art/runtime/runtime.cc:415]   kernel: __switch_to+0x74/0x8c
F art     : art/runtime/runtime.cc:415]   kernel: do_sigtimedwait+0x160/0x208
F art     : art/runtime/runtime.cc:415]   kernel: compat_SyS_rt_sigtimedwait+0x80/0xe8
F art     : art/runtime/runtime.cc:415]   kernel: el0_svc_naked+0x20/0x28
F art     : art/runtime/runtime.cc:415]   native: #00 pc 00041ec4  /system/lib/libc.so (__rt_sigtimedwait+12)
F art     : art/runtime/runtime.cc:415]   native: #01 pc 0001ce73  /system/lib/libc.so (sigwait+22)
F art     : art/runtime/runtime.cc:415]   native: #02 pc 0031898b  /system/lib/libart.so (_ZN3art13SignalCatcher13WaitForSignalEPNS_6ThreadERNS_9SignalSetE+62)
F art     : art/runtime/runtime.cc:415]   native: #03 pc 00319a5b  /system/lib/libart.so (_ZN3art13SignalCatcher3RunEPv+202)
F art     : art/runtime/runtime.cc:415]   native: #04 pc 000407bb  /system/lib/libc.so (_ZL15__pthread_startPv+30)
F art     : art/runtime/runtime.cc:415]   native: #05 pc 0001a051  /system/lib/libc.so (__start_thread+6)
F art     : art/runtime/runtime.cc:415]   (no managed stack frames)
F art     : art/runtime/runtime.cc:415]
F art     : art/runtime/runtime.cc:415] "JDWP" prio=5 tid=3 WaitingInMainDebuggerLoop
F art     : art/runtime/runtime.cc:415]   | group="" sCount=1 dsCount=0 obj=0x12c0f0a0 self=0xee33ce00
F art     : art/runtime/runtime.cc:415]   | sysTid=29801 nice=0 cgrp=default sched=0/0 handle=0xf3e13930
F art     : art/runtime/runtime.cc:415]   | state=S schedstat=( 797230 904309 4 ) utm=0 stm=0 core=8 HZ=100
F art     : art/runtime/runtime.cc:415]   | stack=0xf3d17000-0xf3d19000 stackSize=1014KB
F art     : art/runtime/runtime.cc:415]   | held mutexes=
F art     : art/runtime/runtime.cc:415]   kernel: __switch_to+0x74/0x8c
F art     : art/runtime/runtime.cc:415]   kernel: unix_stream_recvmsg+0x4b0/0x714
F art     : art/runtime/runtime.cc:415]   kernel: sock_recvmsg+0xa4/0xc8
F art     : art/runtime/runtime.cc:415]   kernel: ___sys_recvmsg+0xcc/0x220
F art     : art/runtime/runtime.cc:415]   kernel: __sys_recvmsg+0x3c/0x84
F art     : art/runtime/runtime.cc:415]   kernel: compat_SyS_recvmsg+0xc/0x18
F art     : art/runtime/runtime.cc:415]   kernel: el0_svc_naked+0x20/0x28
F art     : art/runtime/runtime.cc:415]   native: #00 pc 00042ca4  /system/lib/libc.so (recvmsg+8)
F art     : art/runtime/runtime.cc:415]   native: #01 pc 003d9ac9  /system/lib/libart.so (_ZN3art4JDWP12JdwpAdbState15ReceiveClientFdEv+80)
F art     : art/runtime/runtime.cc:415]   native: #02 pc 003da24d  /system/lib/libart.so (_ZN3art4JDWP12JdwpAdbState6AcceptEv+88)
F art     : art/runtime/runtime.cc:415]   native: #03 pc 0024cc37  /system/lib/libart.so (_ZN3art4JDWP9JdwpState3RunEv+222)
F art     : art/runtime/runtime.cc:415]   native: #04 pc 0024daef  /system/lib/libart.so (_ZN3art4JDWPL15StartJdwpThreadEPv+10)
F art     : art/runtime/runtime.cc:415]   native: #05 pc 000407bb  /system/lib/libc.so (_ZL15__pthread_startPv+30)
F art     : art/runtime/runtime.cc:415]   native: #06 pc 0001a051  /system/lib/libc.so (__start_thread+6)
F art     : art/runtime/runtime.cc:415]   (no managed stack frames)
F art     : art/runtime/runtime.cc:415]

@ftylitak
Copy link
Owner

ftylitak commented Sep 1, 2017

Have you already done the change to the project to use gradle?

Moreover, you are targeting Android 6 (API 23). On what device are you testing it on? Is it Android 6 device?

@pangpangshui
Copy link
Author

pangpangshui commented Sep 2, 2017

Now I use gradle and I have built QZXingLive project successfully. When I open app, it ask me for the permissions of camera and RW SDcard and I confirm it. But nothing happend when I get in app. My testing device is Redmi note4 with Android 6.0. Qt give me the debug info like this:

W GLConsumer: [SurfaceTexture-0-16419-0] bindTextureImage: clearing GL error: 0x502
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D libQZXingLive.so: qrc:/main.qml:122 (onDecodingFinished): qml: frame finished: false 0 0 1
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
D MALI : gles_state_set_error_internal:75: [MALI] GLES ctx: 0xd9fc0008, error code:0x502
D MALI : gles_state_set_error_internal:76: [MALI] GLES error info: is GL_UNSIGNED_SHORT_5_6_5 and is not GL_RGB (or) is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and is not GL_RGBA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 2048
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : eglCreateImageKHR:511: [Crop] 0 0 0 0 img[2224 1668]
W GLConsumer: [SurfaceTexture-0-16419-0] bindTextureImage: clearing GL error: 0x502
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I BufferQueueProducer: SurfaceTexture-0-16419-0 queueBuffer: fps=11.64 dur=1030.96 max=100.16 min=54.34
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D libQZXingLive.so: qrc:/main.qml:122 (onDecodingFinished): qml: frame finished: false 351 175.5 2
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : gles_state_set_error_internal:75: [MALI] GLES ctx: 0xd9fc0008, error code:0x502
D MALI : gles_state_set_error_internal:76: [MALI] GLES error info: is GL_UNSIGNED_SHORT_5_6_5 and is not GL_RGB (or) is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and is not GL_RGBA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
W GLConsumer: [SurfaceTexture-0-16419-0] bindTextureImage: clearing GL error: 0x502
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D libQZXingLive.so: qrc:/main.qml:122 (onDecodingFinished): qml: frame finished: false 317 222.66666666666666 3
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : gles_state_set_error_internal:75: [MALI] GLES ctx: 0xd9fc0008, error code:0x502
D MALI : gles_state_set_error_internal:76: [MALI] GLES error info: is GL_UNSIGNED_SHORT_5_6_5 and is not GL_RGB (or) is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and is not GL_RGBA

@pangpangshui
Copy link
Author

pangpangshui commented Sep 4, 2017

@ftylitak Error also happened when I built your project "QZXingLive". The log is as follows:

W CameraBase: An error occurred while connecting to camera: 0
E Camera-JNI: android_hardware_Camera_native_setup Error: -1
E Camera : Camera new cameraInitNormal:-1
E Camera : Camera new cameraInitNormal:0
W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502
W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502
W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502
W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502
W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502

@ftylitak
Copy link
Owner

ftylitak commented Sep 6, 2017

@zjq19930322 in both of your 2 previous comments you refer to the QZXingLive project though in the last comment you mention it as if it was something separate from the previous one. I am a bit confused. Could you please explain better?

To my understanding, it is this one project (QZXingLive) that you are trying to make it work.
Though, in the comment before your last one i see that the decoding if functional though it has not detected any barcodes. Is this correct? Is the camera view shown correctly? Does the application crashes?

@pangpangshui
Copy link
Author

I‘m sorry I hadn't express exactly. It actually can decode the QRcode in Android 5.1 but there is nothing shows and it seems that the app can't call camera. When I put my phone camera in front of the QRcode, the app can't decode the QRcode. Its inconceivable.

But when I try it in Android 6.0 phone. Nothing happened. Among the bug info there is a red info:

W GLConsumer: [SurfaceTexture-0-32034-0] bindTextureImage: clearing GL error: 0x502

It's so wired. My English is not very good. Glad you can help me debug.

@Deepoff
Copy link

Deepoff commented Nov 16, 2017

Confirm the bug! On Android 6.0 does not recognize QR codes. Moreover, if I try to parse the code not using a filter, and directly using the code from the readme

function decode(preview) { imageToDecode.source = preview decoder.decodeImageQML(imageToDecode); }

it seems the line

imageToDecode.source = preview

is not working. Although the image displays in the picture on the screen. But in a library like misses. I think the problem here may be with the data buffer.

The only way to work with the library that I could implement is to save the image to a file by pressing a button

Button {
           id: scan
           text: "Scan"
           onClicked: camera.imageCapture.captureToLocation("qr.jpg")
       }

and then read it from a file

            onImageSaved: {
                qzxing.decodeImageQML(path);
            }

@ftylitak
Copy link
Owner

Closing this as unresolved. If you continue to experience problems, reopen the issue with updated info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants