-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Problem with Android 6.0.1 #139
Comments
I created an app using this same plugin but it's only works in android 4, I tested my app on android 5.1.1 and android 6.0.1, but it's not doing anything on a scan button click. Not opening the camera. Even I found none of my functions are working on those platform. Also I found following link, which may be help you: |
I have the same error in Android 6.x.x. Unfortunately there was an error with the Android-Camera. It could be that you need to restart your device. Till Android 5.x.x, it's working but not for the Android 6. So how can I test with this Android zxing integration? I am totally new to this. What steps I need to follow? Sicerely |
For me, this problem only shows when I add the facebook4 plugin (https://www.npmjs.com/package/cordova-plugin-facebook4). If I remove this from my package, the camera starts working again. I'm not sure if that's a compatibility problem on the fb plugin side, or on this plugins side... |
I am also facing this problem. I was developing an app with an Android Lollipop phone as test device and the scanner was working, after the update to marshmallow it throws the noted error. Also updated to the latest cordova, android platform with no success. Any temporal fixes or work arounds? |
A potential workaround is to change your target sdk version to 22 (Lollipop) instead of 23 (Marshmallow).
In
I had the same problems as above. Updated cordova to 6, Cordova Android to 5.1 and nothing worked. Then I dowgraded my sdk and that fixed it. Building to Android 5 and Android 6 devices with the old sdk works fine. |
Thanks for the suggestion @vdamyanov! I'm regenerating the platform directories as part of our build process, so I added the config to our config.xml:
Seems to have done the trick for now! |
Same here. Cannot get it to work when installing with VS 2015 with TACO update 7. I am deploying it on a nexus 6p. Used to work before getting the latest TACO update. |
I had the same Problem. I looked in the link from @vrushankshukla and like it says I updated my Android version with |
For Android 6+, because of the "permission" issue, If you got the message "Sorry, the camera encountered a problem. You may need to restart the device.", go to Settings - Apps - find "your app name" - select Permissions and switch on "Camera". |
I have the same problem here. It's related to the new Android 6 (API 23) permissions. Setting the targetSdkVersion to "22" solves the problem for now, but this should be fixed. This is the exception in logcat: |
Any progress on this? |
Image upside down on tablet #20 Android UI doesn't support Portrait and is small #4 Prebuilt Zebra Crossing (xzing) Library #3 Forcing landscape on camera android #17 And also fixes these issues found here (possibly others as well): Android Nexus 5x upside down images phonegap/phonegap-plugin-barcodescanner#175 Support Aztec for Android and Ios phonegap/phonegap-plugin-barcodescanner#195 Android: Force landscape orientation? phonegap/phonegap-plugin-barcodescanner#177 Android M issues. Due to new intent/permissions phonegap/phonegap-plugin-barcodescanner#167 Problem with Android 6.0.1 phonegap/phonegap-plugin-barcodescanner#139 Is the zxing version used years away from the original zxing lib? phonegap/phonegap-plugin-barcodescanner#124 Updating ZXing Library phonegap/phonegap-plugin-barcodescanner#59
@loyalpocket : I need to set that exact permission u specified Programatically.. is it possible????? |
I got the same issue. This permission in Android 6 needs to be set programmatically before compiling the app. Any one knows where it could be set for this matter? |
Is there any official fix for this yet? |
I got a fix by installing a plugin: https://github.com/dpa99c/cordova-diagnostic-plugin#requestcameraauthorization with requestCameraAuthorization() function You gotta detect the user Android OS version then call this plugin when it's greater than 6.0 to pop up system native permission so that the user can interact with your app to allow or deny. This action can't be overridden programatically. For more info. regarding to this matter, follow the link from Google: http://developer.android.com/training/permissions/requesting.html Hope this help. |
Is helped me to solve my issue. Thank You :) |
This plugin work with me. |
I solved this with https://github.com/NeoLSN/cordova-plugin-android-permission by checking (and requesting /if needed/) permissions in my onDeviceReady callback. It's all about android 6 requests permissions at runtime not during the installation. |
Is there any new plugin available? |
edit: Just saw, @robertklein already suggested that already. Another proper fix to this problem, without changing the plugin at all, is to use another, more general Android permissions plugin and request the CAMERA permission from your javascript like this: var permissions = cordova.plugins.permissions;
permissions.hasPermission(permissions.CAMERA, checkPermissionCallback, null);
function checkPermissionCallback(status) {
if(!status.hasPermission) {
var errorCallback = function() {
console.warn('Camera permission is not turned on');
}
permissions.requestPermission(
permissions.CAMERA,
function(status) {
if(!status.hasPermission) errorCallback();
},
errorCallback);
}
} That works good for me, as I have to stay on |
After lower the SDK version to 22,
also not working for me? Any other solution is there? |
I commented the solution just above ur post |
I am getting the same issue, i designed a audio recorder app it works good in lolli-pop, kit-kat and in naugat but that same is not working in marshmallow, i use cordova media plugin
could someone help me. |
I confirm the issue and being solved by downgrading/changing the SDK version. In my case, from 23 to 22. In my case, I require to use cordova-plugin-barcodescanner and camera. The first one just throws an alert, the second one asks for screen overlap permission (which is granted, but Android doesnt care anyways). config.xml
|
Guess it's the camera permission setting for the application(allowing to use the camera). it worked for Samsung edge(Android 7) |
I met same the problem in cordova, and I think phonepgap also run same cordova, after request permisson , u can check permission access camera and if it has no problem. |
This thread has been automatically locked. |
I get an error on Android 6.0.1 saying that there was an error with the "Android Camera", (the message is in German, but it may translate to:
Unfortunately there was an error with the Android-Camera. It could be that you need to restart your device.
Does anyone see this?
The text was updated successfully, but these errors were encountered: