HillsideHoldings / cordova-lock-screen-media-controls

A Cordova plugin that allows you to manage the media controls on the lock screen. Things such as play, pause, fast forward, rewind, title and graphic.
0 stars 0 forks source link

Issue with Building the app with the plugin #4

Open sudarshann opened 8 years ago

sudarshann commented 8 years ago

I get the below build error. I was able to isolate error occurs only when I add this plugin. Researching regarding this error some sources says to update android-support-v4.jar to some later versions.

This plugin is used as part of this app https://github.com/HillsideHoldings/keithandthegirl-app

Build error:

:transformClassesWithDexForArmv7Debug UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; FAILED 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)

BUILD FAILED

Total time: 1 mins 41.335 secs

FAILURE: Build failed with an exception.

MichaelApproved commented 8 years ago

The problem is with duplicate android-support-v4.jar files. The temporary solution is to delete the file from /platforms/android/libs/

Here http://stackoverflow.com/questions/26342444/multiple-dex-files-define-landroid-support-annotation-animres#comment52678288_26713987

@alienslab02 Can you please address the duplicate file issue so we won't have to delete the file from within the platform?

alienslab02 commented 8 years ago

Hi,

The problem is not with the plugin. As this plugin depends on support-v4.jar file so it is mandatory for this plugin. If we remove this file from plugin then user have to add this file manually in platform.

It seems you have any other plugin that also install this file. Resulting two same files from two different plugins in one project. Only way is to delete one from the other plugin. One project should have one support-v4.jar file.

If you don't have any other plugin that have support-v4.jar file other than this plugin then you must check your build.gradle file, it seems one dependency for support-v4 is added in build.gradle file and one is added by this plugin in platform/android/libs folder. So the solution is, Remove support-v4.jar from libs folder.

Thanks.

Bilal Shabbir Email: alienslab02@gmail.com Skype: alienslab02