bitpay / cordova-plugin-qrscanner

A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
MIT License
568 stars 772 forks source link

Preview not working Android (Crosswalk) - Any Update? #107

Closed theknown closed 6 years ago

theknown commented 6 years ago

It all works fine on iOS. Perfect!

However, on Android (with crosswalk), the preview screen doesn't show. I tried everything (in terms of making overlapping layers transparent). That is not the the problem.

Preview screen doesn't show. When you hold a QR code in front of the camera though, it does throw the success event. So apparently it is scanning for Android, but it doesn't display the camera screen.

I've read this issue is related to Crosswalk on Android? Is there a fix? Will there be a fix?

Let me know.

dcousens commented 6 years ago

@theknown see how https://github.com/bitpay/cordova-plugin-qrscanner/pull/96 works for you... it isn't complete functionality. But it can give you a working camera and preview.

theknown commented 6 years ago

I'm not sure if I understand that correctly, but I just replaced the 2 files with the new ones in that thread (#96):

Still the exact same issue on Android.. No camera preview.

dcousens commented 6 years ago

@theknown are you sure it re-compiled as required? There are multiple copies made by cordova.

theknown commented 6 years ago

I just tested again on multiple android devices with the modified code that you mentioned (#96).

Android now opens the camera preview in the app. However, the preview is a black screen all the time.

Again, holding a QR code in front of the camera and it throws the success event. But instead of showing no camera preview on Android, it now shows a completely black camera preview.

Thoughts?

dcousens commented 6 years ago

@theknown apply https://github.com/dcousens/cordova-plugin-qrscanner/commit/be4376cda07ebfc1d412feec4807d62b16c85e81 - it was what I settled with.

theknown commented 6 years ago

Still not working for me. Could I hire you to take a look at it on teamviewer on my computer @dcousens

I just sent you an email through your site.

Nauzer commented 6 years ago

I had the same issue. It is because of 'Animatable' setting of Crosswalk. Adding the following helped to show preview on Android with Xwalk:

for config.xml (if regular Cordova project) <preference name="CrosswalkAnimatable" value="true" />

for meteor mobile-config.js (for meteor project) App.setPreference('CrosswalkAnimatable', true);

bitjson commented 6 years ago

It's been a while here, so I'm going to close this. If anyone is still having trouble, feel free to open a new issue.

sJonatas commented 5 years ago

@Nauzer solution worked fine for me! TYSM!

RobbertWolfs commented 5 years ago

This works without xwalk.. but with xwalk enabled our preview is black..

scanning still works but no preview...

zhang-teng-da commented 3 years ago

I'm new for cordova ,but I think I've found a solution to this issue. This plugin's camera preview works much like cordova-plugin-googlemaps, add the following to config.xml <preference name="xwalkZOrderOnTop" value="true" /> <preference name="BackgroundColor" value="0" />

my cordova-plugin-crosswalk-webview version is 2.4.0

hope it helps