NathanaelA / nativescript-zxing

ZXing for NativeScript
Other
15 stars 22 forks source link

error on android #3

Closed cutout33 closed 8 years ago

cutout33 commented 8 years ago

Hi,

Am getting the following error on android

Exception in thread "main" java.lang.IllegalArgumentException: Class com.google.zxing.pdf417.PDF417ResultMetadata conflict: /android/build/intermediates/exploded-aar/barcodescanner-release-2.0.2/jars/classes.jar and /.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

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildMetadata'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
NathanaelA commented 8 years ago

Are you using the NativeScript-Barcodescanner plugin with this one. If so, this is a known incompatibility because of the way the Barcodescanner plugin author built his plugin. However you can fix it by manually removing the /node_modules/nativescript-zxing/platforms/android folder...

cutout33 commented 8 years ago

I tried that, but it is not working for me. I deleted the folder and removed/added the platform and built. but it didn't work, same error.

cutout33 commented 8 years ago

never mind it worked as you told me, but I had to delete the android folder from platforms and call the following:

tns platform add android
tns prepare android
tns build android