0
votes

I am trying to integrate Paypal SDK for phonegap and compiling for android version. Getting the below error.

  • What went wrong:

Execution failed for task ':dexDebug'.

> com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Android\adt-bundle-windows-x86_64-20140702\sdk\build-tools\23.0.1\dx.bat --dex --no-optimize --output C:\Android\apps\InsureScan\platforms\android\build\intermediates\dex\debug --input-list=C:\A ndroid\apps\InsureScan\platforms\android\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lio/card/payment/Validator;
            at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
            at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
            at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
            at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
            at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
            at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
            at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
            at com.android.dx.command.dexer.Main.run(Main.java:277)
            at com.android.dx.command.dexer.Main.main(Main.java:245)
            at com.android.dx.command.Main.main(Main.java:106)

Total time: 1 mins 33.723 secs

C:\Android\apps\InsureScan\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ Error code 1 for command: cmd with args: /s /c "C:\Android\apps\InsureScan\platforms\android\gradlew cdvBuildDebug -b C:\Android\apps\InsureScan\platforms\android\build.gradle -Dorg.gradle.daemon=true"

ERROR building one of the platforms: Error: cmd: Command failed with exit code 1 You may not have the required environment or OS to build this project

Error: cmd: Command failed with exit code 1 at ChildProcess.whenDone (C:\Users\Saleel\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:817:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

1

1 Answers

0
votes

I found the solution. I was having another plugin installed and it was having some libraries which were conflicting with the new plugin.

I uninstalled the other plugin(which was not of use to me) and this resolved the issue.