这是堆栈跟踪:
04-10 18:09:36.393: E/AndroidRuntime(26592): FATAL EXCEPTION: main
04-10 18:09:36.393: E/AndroidRuntime(26592): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.jujitsu.app.com/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassNotFoundException: com.google.zxing.client.android.CaptureActivity in loader dalvik.system.PathClassLoader[/data/app/org.jujitsu.app.com-1.apk]
04-10 18:09:36.393: E/AndroidRuntime(26592): atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.os.Looper.loop(Looper.java:143)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.ActivityThread.main(ActivityThread.java:4196)
04-10 18:09:36.393: E/AndroidRuntime(26592): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 18:09:36.393: E/AndroidRuntime(26592): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 18:09:36.393: E/AndroidRuntime(26592): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-10 18:09:36.393: E/AndroidRuntime(26592): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-10 18:09:36.393: E/AndroidRuntime(26592): at dalvik.system.NativeStart.main(Native Method)
04-10 18:09:36.393: E/AndroidRuntime(26592): Caused by: java.lang.ClassNotFoundException: com.google.zxing.client.android.CaptureActivity in loader dalvik.system.PathClassLoader[/data/app/org.jujitsu.app.com-1.apk]
04-10 18:09:36.393: E/AndroidRuntime(26592): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-10 18:09:36.393: E/AndroidRuntime(26592): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-10 18:09:36.393: E/AndroidRuntime(26592): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
04-10 18:09:36.393: E/AndroidRuntime(26592): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
04-10 18:09:36.393: E/AndroidRuntime(26592): ... 11 more
这是我的清单声明。
<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>
这是发生错误的时间/地点:
public void onClick(View v){
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
当我选择我拥有的随机 QR 码阅读器时它可以正常工作,但是当我将该应用程序用作 QR 码阅读器时,它会出现此错误。
我对它为什么这样做有点困惑......我的 Eclipse 项目中的引用库中也有 core.jar......也许核心不完整?