这是stacktrace:
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也许......核心是不是已经满了?
答案 0 :(得分:0)
已经在邮件列表上回答了这个问题。您需要删除项目中android/
和core/
的所有使用情况。这些都不应该首先出现。请阅读并遵循http://code.google.com/p/zxing/wiki/ScanningViaIntent
答案 1 :(得分:0)
没有必要使用不同的项目作为您自己项目的源代码zxing包代码不应该被篡改。