RootTools.jar and OneSignal SDK creates duplicate entry error

398 Views Asked by At

I have android project that include RootTools.jar, it was run without any problem, but when I add OneSignal SDk by following this guide: Android SDK Installation (Android Studio) I got error when try to run it:

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/stericson/RootTools/internal/RootToolsInternalMethods.class

I tried to debug it and got this:

10:36:07.391 [DEBUG] [com.android.build.gradle.internal.transforms.JarMerger] addJar(C:\Apps\SatpolApp\app\build\intermediates\exploded-aar\com.onesignal\OneSignal\2.1.2\jars\classes.jar): entry com/onesignal/TrackGooglePurchase.class

10:36:07.399 [DEBUG] [com.android.build.gradle.internal.transforms.JarMerger] ad dJar(C:\Apps\SatpolApp\app\build\intermediates\exploded-aar\com.onesignal\OneSignal\2.1.2\jars\classes.jar): entry com/stericson/RootTools/internal/RootToolsInternalMethods.class

10:36:08.363 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:transformClassesWithJarMergingForDebug'

10:36:08.370 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:transformCl assesWithJarMergingForDebug FAILED

So I found out that OneSignal jar has com/stericson/RootTools/internal/RootToolsInternalMethods.class which cause the duplicate entry error since I already include RootTools.jar.

What I want to ask is how I exclude the "com/stericson/RootTools/internal/RootToolsInternalMethods.class" from OneSignal jar while keep it functioning?

1

There are 1 best solutions below

0
On BEST ANSWER

This class was baked into the .jar in the .aar file. The class name conflict is now resolved in version 2.1.3 of the OneSignal Android SDK.