Android Question QRCodeReaderView Not working

Ibrahim Saleh

Member
Licensed User
Longtime User
Hello there, I'm having an issue with this QRCodeReaderView Lib. it works well when I try the example but once I put it inside my project, I'm not able to compile my app at all.
for more info, I have CameraExClass also in the same project and some other QRcodeGenerator.
B4X:
B4A Version: 11.00
Parsing code.    (0.29s)
    Java Version: 8
Building folders structure.    (0.05s)
Compiling code.    (0.49s)
Compiling layouts code.    (0.19s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.35s)
Linking resources    (2.51s)
Compiling generated Java code.    (7.27s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/BarcodeFormat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/Binarizer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/BinaryBitmap;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/ChecksumException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/DecodeHintType;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/Dimension;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/EncodeHintType;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/FormatException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/InvertedLuminanceSource;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
    at com.android.dx.command.dexer.Main.runDx(Main.java:291)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
    ... 4 more
 
Solution
Looks like a conflict with QRCodeReaderView and the other QRcodeGenerator library as both are including the zxing library. Easiest is to choose one or the other.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…