Zxing最新的lib是否支持像我的Android 2.3.6这样的低端设备?
我无法扫描Qrcode,minSdkversion = 10且targetSdkversion = 18
07-21 16:00:54.382: E/AndroidRuntime(7464): FATAL EXCEPTION: main
07-21 16:00:54.382: E/AndroidRuntime(7464): java.lang.NoSuchFieldError: android.os.AsyncTask.THREAD_POOL_EXECUTOR
07-21 16:00:54.382: E/AndroidRuntime(7464): at com.google.zxing.client.android.InactivityTimer.onActivity(InactivityTimer.java:52)
07-21 16:00:54.382: E/AndroidRuntime(7464): at com.google.zxing.client.android.InactivityTimer.<init>(InactivityTimer.java:46)
07-21 16:00:54.382: E/AndroidRuntime(7464): at com.google.zxing.client.android.CaptureActivity.onCreate(CaptureActivity.java:139)
07-21 16:00:54.382: E/AndroidRuntime(7464): at
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.os.Handler.dispatchMessage(Handler.java:99)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.os.Looper.loop(Looper.java:130)
07-21 16:00:54.382: E/AndroidRuntime(7464): at android.app.ActivityThread.main(ActivityThread.java:3687)
07-21 16:00:54.382: E/AndroidRuntime(7464): at java.lang.reflect.Method.invokeNative(Native Method)
07-21 16:00:54.382: E/AndroidRuntime(7464): at java.lang.reflect.Method.invoke(Method.java:507)
07-21 16:00:54.382: E/AndroidRuntime(7464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
07-21 16:00:54.382: E/AndroidRuntime(7464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
07-21 16:00:54.382: E/AndroidRuntime(7464): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:1)
您的答案就在您发布的日志中:
java.lang.NoSuchFieldError: android.os.AsyncTask.THREAD_POOL_EXECUTOR
它实际上告诉你,类AsyncTask
中没有名为THREAD_POOL_EXECUTOR的字段。如果你看the documentation for this field,你会看到:
public static final Executor THREAD_POOL_EXECUTOR
在API级别11中添加 可用于执行任务的执行程序 平行。
这里的重要部分是 ADDED IN API LEVEL 11 。所以不,无论该库在做什么,只能在API级别11(Android 3.0 Honeycomb)及以上版本中运行。
但我想这可能只是一个错误,并行执行是早期Android版本的默认设置。我不知道图书馆为什么不回避这个实现。