我有包含RootTools.jar的android项目,它运行没有任何问题,但是当我按照本指南添加OneSignal SDk时: Android SDK Installation (Android Studio)尝试运行时遇到错误:
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/stericson/RootTools/internal/RootToolsInternalMethods.class
我尝试调试它并得到了这个:
10:36:07.391 [DEBUG] [com.android.build.gradle.internal.transforms.JarMerger] addJar(C:\ Apps \ SatpolApp \ app \ build \ intermediates \ explosion-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]广告 dJar(C:\ Apps \ SatpolApp \ app \ build \ intermediates \ explosion-aar \ com.onesignal \ OneSignal \ 2.1.2 \ jars \ classes.jar):entry COM / stericson / RootTools /内部/ RootToolsInternalMethods.class
10:36:08.363 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] 完成执行任务':app:transformClassesWithJarMergingForDebug'
10:36:08.370 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:transformCl assesWithJarMergingForDebug FAILED
所以我发现OneSignal jar有com / stericson / RootTools / internal / RootToolsInternalMethods.class导致重复输入错误,因为我已经包含了RootTools.jar。
我想问的是我如何从OneSignal jar中排除“com / stericson / RootTools / internal / RootToolsInternalMethods.class”,同时保持其正常运行?