hypery2k / cordova-barcodescanner-plugin

barcode scanner plugin for PhoneGap
51 stars 39 forks source link

Issue with camera on Android 6.1 #19

Closed akashs1706 closed 7 years ago

akashs1706 commented 7 years ago

I am using this plugin to for scanner, but while testing the app in Android 6.1 it displays an error "Sorry, the camera encountered a problem. You may need to restart the device". How can i overcome this issue.

bpocallaghan commented 7 years ago

Hi Akash - I am having the same issue. I've also tried a few different barcode scanners - no luck.

Below are screenshots of the device's software info and the error message.

Software Info Error Modal

If you set your target SDK Version to 22 - it should work. Unfortunately I've already uploaded the app for 23 - and Google Store does not allow to downgrade the SDK version...

akashs1706 commented 7 years ago

Thanks @bpocallaghan for the reply. I have tried for that also but no luck. I am wondering if there is another solution?

If there is any hack for camera permissions before scanner opens?

bpocallaghan commented 7 years ago

Do you mean that you tried setting it to target sdk = 22 without any success?

I use phongap build - in my config.xml I have <preference name="android-targetSdkVersion" value="22" /> - seems to work <preference name="android-targetSdkVersion" value="23" /> - does not work

Features / Permissions <feature name="http://api.phonegap.com/1.0/camera"/>

Plugins <gap:plugin name="cordova-plugin-barcodescanner" source="npm" />

I think I will try this plugin 'phonegap-plugin-barcodescanner' - [github] [npm]

bpocallaghan commented 7 years ago

Hi Akash.

Just wanted to let you know 'phonegap-plugin-barcodescanner' - [github] [npm] works on latest android! :)

Please let me know if you have any issues...

akashs1706 commented 7 years ago

@bpocallaghan Thanks for suggestions. I just installed Phonegap barcodescanner plugin. will let you know after testing it on some latest android versions. Thanks.

hypery2k commented 7 years ago

could you try

cordova plugin add cordova-plugin-barcodescanner@next

?

eurigilberto commented 7 years ago

I tried using "cordova plugin add cordova-plugin-barcodescanner@next" but when I build the app, I cannot install it on my device.

sam2996 commented 7 years ago

To solve this problem, you can give 'Camera permission'