Ionic AztectDetectorResult.class error

Hey everyone,

I have been keeping on getting this error in ionic all of a sudden

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/aztec/AztecDetectorResult.class

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

[ERROR] An error occurred while running cordova emulate android (exit code 1).


This error goes away after I uninstall phonegap-plugin-barcodescanner. However, after reinstalling phonegap-plugin-barcodescanner, the error arises again. (Note: I have been using barcode scanner for a couple of months now and it never caused any issues until now). Any help would be greatly appreciated! :slight_smile:

Hi, I have the same problem too. :tired_face:

I am trying to change the graddle file but I did not succeed.

But I still have not given up if I can evolve with something I’ll be happy to share!

I was able to get my issue figured out.

I ran npm install gradle

Then I removed the android platform and readded it. Then everything worked fine.

Hopefully this helps you! :slight_smile:

I tried the same procedure here but I did not succeed.

I’ll share my log here.

    * What went wrong:
    Execution failed for task ':transformClassesWithDexForDebug'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
    java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define
    Lcom/google/zxing/BarcodeFormat;

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

    BUILD FAILED

    Total time: 9.397 secs
    Error: /Users/leandrogoncalves/Projetos/ionic3/testQrCode/platforms/android/gradlew: Command failed with exit
    code 1 Error output:
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':transformClassesWithDexForDebug'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
    java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define
    Lcom/google/zxing/BarcodeFormat;

    * Try:

Can you provide a list of your plugins being installed (cordova plugin ls)?