Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Conflict with Nativescript-barcodeScanner #4

Closed
xerotolerant opened this issue Oct 23, 2016 · 3 comments
Closed

Conflict with Nativescript-barcodeScanner #4

xerotolerant opened this issue Oct 23, 2016 · 3 comments

Comments

@xerotolerant
Copy link

Hello this plugins is conflicting with nativesript-zxing and I need both for my application.

Exception in thread "main" java.lang.IllegalArgumentException: Class com.google.zxing.pdf417.PDF417ResultMetadata conflict: /Users/kheenan/Documents/ExerClub/platforms/android/build/intermediates/exploded-aar/barcodescanner-release-2.0.2/jars/classes.jar and /Users/kheenan/.gradle/caches/modules-2/files-2.1/com.google.zxing/core/3.2.1/2287494d4f5f9f3a9a2bb6980e3f32053721b315/core-3.2.1.jar
at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21)
at com.telerik.metadata.Builder.build(Builder.java:39)
at com.telerik.metadata.Generator.main(Generator.java:44)
:buildMetadata FAILED

I need both one to scan qr code and another to display them.
This one displays the codes really well however cannot scan them from the camera (as far as I can tell)
What do I need to do to have them play well together.

@NathanaelA NathanaelA changed the title Conflict with another plugin Conflict with Nativescript-barcodeScanner Oct 23, 2016
@NathanaelA
Copy link
Owner

Ah yeah, the way Eddy developed NS-Barcodescanner doesn't allow them to play nicely, he built the main library into his distributed library; so it has a different name -- so they don't get merged... So then the meta data generator fails because of the duplication symbols inside for two different zxing libraries that are attempting to be built in together...

However, the good news is there is a very EASY fix.

After installing my plugin you just need to delete the following folder node_modules/nativescript-zxing/platforms/android and then do a full rebuild of your app. Because Eddy brings in the entire Zxing library in his barcode library; my code will use the Zxing library that is embedded by Eddy's plugin.

@Cselt
Copy link

Cselt commented Dec 4, 2016

A more elegant way to add these lines to your app.gradle file in app/App_Resources/Android

configurations {
    compile.exclude group: 'com.google.zxing'
}

@tebanep
Copy link

tebanep commented Aug 4, 2017

Thanks a lot @NathanaelA and @Cselt! This issue had me struggling for 3 hours! I first thought it was
EddyVerbruggen/nativescript-barcodescanner#24 or NativeScript/android#344, but the problem happened to be this conflict.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants