Phonegap-plugin-barcodescanner: Android Nexus 5x upside down images

Created on 21 Feb 2016  Â·  25Comments  Â·  Source: phonegap/phonegap-plugin-barcodescanner

The new android phones have the camera upside down in them, as a result the scan displays upside down in the nexus 5x.

bug android6

Most helpful comment

Ok - I finally got it work - here is what I did:

1) Take the build that @EddyVerbruggen is referencing (the .aar file, https://github.com/Telerik-Verified-Plugins/BarcodeScanner/blob/master/src/android/barcodescanner-release-2.0.0.aar), and then add it to your /libs directory.
2) In your gradle file, add
flatDir { dirs 'libs' } to the repositories section.
3) In dependencies section - add compile(name:'barcodescanner', ext:'aar')

Appears to work with these steps -but don't have Nexus to test.

All 25 comments

138 is related, otherwise +1, we are having the same problem on a Nexus 5x.

Same issue here

Any progress on this?

Any update on this?

This can be fixed by updating the ZX library to the latest. I haven't done any tests on this, but here's the Github issue https://github.com/zxing/zxing/issues/484

@infil00p I guess it's unclear which JAR we should be using in place of this. They provide pre-build JARs: http://repo1.maven.org/maven2/com/google/zxing/, but I'm unclear which one is to be used here.

Can anybody fix this? :)

Been hoping for awhile :-) I even made some comments on some of the git
pages

On Fri, Apr 8, 2016 at 4:30 PM, rudza [email protected] wrote:

Can anybody fix this? :)

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/175#issuecomment-207646751

We definitely need help from the PG community...

Greg

Sent from my iPhone

On Apr 8, 2016, at 7:44 PM, mikejones3 [email protected] wrote:

Been hoping for awhile :-) I even made some comments on some of the git
pages

On Fri, Apr 8, 2016 at 4:30 PM, rudza [email protected] wrote:

Can anybody fix this? :)

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/175#issuecomment-207646751

—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@vladimir-kotikov by any chance is there a way you can update zxing jar for this plugin?

cc: @gregavola @infil00p

Hi, I just updated my NativeScript plugin to fix a similar issue - I'll make an effort to update my Cordova plugin fork as well.

I'm aiming at using the same ZXing library for both technologies and fix a few issues as well for Android like locking portrait/landscape mode and providing a switch front/back camera button.

Hi, before even remotely considering sending a PR I'd love some folks to verify the changes I've made to the Telerik fork - I don't have a device on which it was a problem and all still seems well to me.

Just got word of a NativeScript developer using the same updated library: it's fixed for him on his Nexus 5x.

@EddyVerbruggen This didn't work for me - I tried to remove the plugin and re-add it, and then sync gradle, and it throws errors saying .zxing is not defined.

@gregavola Have you tried it in a new project and/or removed and re-added the Android platform?

@EddyVerbruggen i cant remove the android platform right now, as it will mess up everything that I have done custom outside the cordova plugman. I think all I really need is the com.google.zxing.client.android.captureactivity.jar that is the latest version. All I need to do is drop that into the library where it was before and we should be good to go.

@gregavola I understand. But I'm not sure what you tried:

  • Uninstall this plugin and install the Telerik fork instead, or
  • Unzipped the .aar I created, extracted classes.jar and renamed it to ...captureactivity.jar?

@EddyVerbruggen I unzipped the .aar and then renamed classes.jar to com.google.zxing.client.android.captureactivity.jar - and got this error:

Didn't find class "barcodescanner.xservices.nl.barcodescanner.R$layout" on path: DexPathList[[zip file "/data/app/com.XXXX.app-2/base.apk"],nativeLibraryDirectories=[/data/app/com.XXXXX.app-2/lib/arm, /data/app/com.XXXXXX.app-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

@EddyVerbruggen I also added the compile files('libs/com.google.zxing.client.android.captureactivity.jar') to my grade file as it wouldn't "compile" unless I did that.

Ok - I finally got it work - here is what I did:

1) Take the build that @EddyVerbruggen is referencing (the .aar file, https://github.com/Telerik-Verified-Plugins/BarcodeScanner/blob/master/src/android/barcodescanner-release-2.0.0.aar), and then add it to your /libs directory.
2) In your gradle file, add
flatDir { dirs 'libs' } to the repositories section.
3) In dependencies section - add compile(name:'barcodescanner', ext:'aar')

Appears to work with these steps -but don't have Nexus to test.

@gregavola I just wanted to add that here, awesome that you was able to figure it out! You didn't sneakily looked at the gradle file I added to the plugin ey :)

For others: please spare yourself the headache and try to use plugman for removing / adding the plugins, but you may need to remove / add the android platform as well (which Greg wanted to avoid, understandably).

This issue shouls be fixed when you pull from the master branch of this repo as we've just merged the Telerik fork with this one.

Works for me as well on Nexus5X with this Telerik Plugin: http://plugins.telerik.com/cordova/plugin/barcodescanner . Thank you!

@EddyVerbruggen ,Hi, do you have any idea about this exception?
java.lang.NoClassDefFoundError: Failed resolution of: Lbarcodescanner/xservices/nl/barcodescanner/R$layout;

This thread has been automatically locked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mlaponder picture mlaponder  Â·  5Comments

SunboX picture SunboX  Â·  9Comments

IYABAO picture IYABAO  Â·  7Comments

thomas-tran picture thomas-tran  Â·  9Comments

joshstrange picture joshstrange  Â·  4Comments