Hi there, I had the same issue, and this is the fix (in my case).
Open Eclipse project where you have the ZXing plugin installed, and
navigate to:
CaptureActivity > src > com.google.zxing.client.android.camera >
CameraConfigurationManager.java
In CameraConfigurationManager.java look for ... (line: 178 or there
about)
private void setFlash(Camera.Parameters parameters) { .... }
and replace it with ...
private void setFlash(Camera.Parameters parameters) {
// getFlashMode() returns NULL if flash mode setting is not supported
//
https://github.com/phonegap/phonegap-plugins/issues/371
Log.d(TAG, "Check supported flash modes: " +
parameters.getSupportedFlashModes());
if(parameters.getFlashMode() == null ||
parameters.getSupportedFlashModes() == null) {
Log.w(TAG, "Cannot set flash mode. Unsupported by this device.");
return;
}
// This is a hack to turn the flash off on the Samsung Galaxy and the
Behold II
// as advised by Samsung, neither of which respected the official
parameter.
if (Build.MODEL.contains("Behold II") && CameraManager.SDK_INT == 3)
{ // 3 = Cupcake
parameters.set("flash-value", 1);
} else {
parameters.set("flash-value", 2);
}
// This is the standard setting to turn the flash off that all
devices should honor.
parameters.set("flash-mode", "off");
}
I have not tested is on other Android devices but it will probably
work fine. If i find it causes troubles I will post again.
Have fun!
Bruce