Integrate OneSignal with android-studio project failed

My project is Cocos2d-js. I tried integrate OneSignal with eclipse project and build success but integrate it with android-studio project failed. Below is my output, Can anyone help me, thank all

    Dex: Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
    UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
        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:454)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)

:KVIPJS:transformClassesWithDexForRelease FAILED
:KVIPJS:transformClassesWithDexForRelease (Thread[main,5,main]) completed. Took 5.412 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':KVIPJS:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_73\bin\java.exe'' finished with non-zero exit value 2

Can you double check if you have android-support and android-support-annotation libraries? they seems to have conflicts

I can’t find android-support-annotations.jar in my Project, maybe it’s not my problem

Can you double check your build.gradle file as well?

My build.gradle files no contain com.android.support

can you do a search and see if there are duplicated jars in different folders?

proj.android-studio\app\build\intermediates\exploded-aar\com.facebook.android\facebook_lib\4.6.0\jars\libs\android-support-v4.jar

My project contain only file android-support-v4.jar at above location

Is there a way I can get your project? or sample project to take a look?

I tried new project and add 6 sdkbox (facebook, googleanalytics, review, iap, apteligent and onesignal), it build done. After, I update gradle of android studio from 1.3.0 to 2.1.0, it build error, output same above :smiley:

@nite I am also having similar issues.
Please help me resolve those, After integration of AdMob,SDKPlay,SDKAds,OneSignal,Facebook getting the below issues.

Created a seperate threads too.


So it works with gradle 1.3, can you use 1.3 for now?
Also can you send me a sample project with this error so I can take a look?