I'm getting a basic droid error with the barcode scanner for Phonegap. I'm sure its a simple fix, or something that i'm missing. I can't seem to put my finger on it. I have imported com.google.zxing.client.android.R
Error Code:
04-29 05:49:38.448: E/AndroidRuntime(12450): java.lang.NoClassDefFoundError: com.google.zxing.client.android.R$layout
04-29 05:49:38.448: E/AndroidRuntime(12450): at com.google.zxing.client.android.CaptureActivity.onCreate(CaptureActivity.java:156)
04-29 05:49:38.448: E/AndroidRuntime(12450): at android.app.Activity.performCreate(Activity.java:4465)
04-29 05:49:38.448: E/AndroidRuntime(12450): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-29 05:49:38.448: E/AndroidRuntime(12450): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-29 05:49:38.448: E/AndroidRuntime(12450): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-29 05:49:38.448: E/AndroidRuntime(12450): at android.app.ActivityThread.access$600(ActivityThread.java:123)
Capture Activity Lines
super.onCreate(icicle);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
#156 --> setContentView(R.layout.capture);
CameraManager.init(getApplication());
viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
resultView = findViewById(R.id.result_view);
statusView = (TextView) findViewById(R.id.status_view);
I ran into this problem again and I can't believe I never posted an answer. I'm sorry, well heres the answer.
You need to add the lib to your eclipse project and ensure that "Is Library" is checked. But then you need to add the zxing library as a reference in your app, as so.