1
我正在嘗試使用ZXing庫對我的條碼掃描器進行編碼。BarCodeScanner已停止
當我開始我的應用程序時一切正常。
按下掃描按鈕後,我得到一個彈出窗口:「BarCodeScanner已停止。」
的logcat:
10-12 10:51:57.674: I/PersonaManager(13977): getPersonaService() name persona_policy
10-12 10:51:57.824: I/Adreno-EGL(13977): <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.050_msm8960_refs/tags/AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.050__release_AU()
10-12 10:51:57.824: I/Adreno-EGL(13977): OpenGL ES Shader Compiler Version: 17.01.12.SPL
10-12 10:51:57.824: I/Adreno-EGL(13977): Build Date: 03/28/14 Fri
10-12 10:51:57.824: I/Adreno-EGL(13977): Local Branch:
10-12 10:51:57.824: I/Adreno-EGL(13977): Remote Branch: refs/tags/AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.050
10-12 10:51:57.824: I/Adreno-EGL(13977): Local Patches: NONE
10-12 10:51:57.824: I/Adreno-EGL(13977): Reconstruct Branch: NOTHING
10-12 10:51:57.864: D/OpenGLRenderer(13977): Enabling debug mode 0
10-12 10:52:01.308: D/AndroidRuntime(13977): Shutting down VM
10-12 10:52:01.318: W/dalvikvm(13977): threadid=1: thread exiting with uncaught exception (group=0x418e9da0)
10-12 10:52:01.318: E/AndroidRuntime(13977): FATAL EXCEPTION: main
10-12 10:52:01.318: E/AndroidRuntime(13977): Process: com.example, PID: 13977
10-12 10:52:01.318: E/AndroidRuntime(13977): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassNotFoundException: Didn't find class "com.google.zxing.client.android.CaptureActivity" on path: DexPathList[[zip file "/data/app/com.example-8.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-8, /vendor/lib, /system/lib]]
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread.access$900(ActivityThread.java:174)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.os.Handler.dispatchMessage(Handler.java:102)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.os.Looper.loop(Looper.java:146)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread.main(ActivityThread.java:5593)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at java.lang.reflect.Method.invokeNative(Native Method)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at java.lang.reflect.Method.invoke(Method.java:515)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at dalvik.system.NativeStart.main(Native Method)
10-12 10:52:01.318: E/AndroidRuntime(13977): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.zxing.client.android.CaptureActivity" on path: DexPathList[[zip file "/data/app/com.example-8.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-8, /vendor/lib, /system/lib]]
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2296)
10-12 10:52:01.318: E/AndroidRuntime(13977): \t ... 12 more
這裏是我的清單:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
我希望你能幫助我。 :)
發佈您的清單文件 – goonerDroid 2014-10-12 09:09:45
Manifest在第一篇文章中。 – Aland 2014-10-12 10:57:21
您是否在您測試此應用的設備上安裝了ZXING應用? – Nabin 2014-10-12 11:00:49