Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/widget/ExploreByTouchHelper.class

I have got following error during Gradle build process:

Error:Execution failed for task > ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/widget/ExploreByTouchHelper.class

I have also checked dependencies:

release
+--- com.android.support:multidex:1.0.1
+--- com.google.android.gms:play-services:8.4.0
|    +--- com.google.android.gms:play-services-ads:8.4.0
|    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |         --- com.android.support:support-v4:23.2.1
|    |              --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-analytics:8.4.0
|    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |         --- com.android.support:support-v4:23.2.1
|    |              --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-appindexing:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-appinvite:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-appstate:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-auth:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-base:8.4.0
|    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |         --- com.android.support:support-v4:23.2.1
|    |              --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-basement:8.4.0
|    |    --- com.android.support:support-v4:23.2.1
|    |         --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-cast:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.android.support:mediarouter-v7:23.0.0
|    |         +--- LOCAL: internal_impl-23.0.0.jar
|    |         --- com.android.support:appcompat-v7:23.2.1
|    |              +--- com.android.support:support-v4:23.2.1
|    |              |    --- LOCAL: internal_impl-23.2.1.jar
|    |              +--- com.android.support:animated-vector-drawable:23.2.1
|    |              |    --- com.android.support:support-vector-drawable:23.2.1
|    |              |         --- com.android.support:support-v4:23.2.1
|    |              |              --- LOCAL: internal_impl-23.2.1.jar
|    |              --- com.android.support:support-vector-drawable:23.2.1
|    |                   --- com.android.support:support-v4:23.2.1
|    |                        --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-drive:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-fitness:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.google.android.gms:play-services-location:8.4.0
|    |         +--- com.google.android.gms:play-services-base:8.4.0
|    |         |    --- com.google.android.gms:play-services-basement:8.4.0
|    |         |         --- com.android.support:support-v4:23.2.1
|    |         |              --- LOCAL: internal_impl-23.2.1.jar
|    |         --- com.google.android.gms:play-services-maps:8.4.0
|    |              --- com.google.android.gms:play-services-base:8.4.0
|    |                   --- com.google.android.gms:play-services-basement:8.4.0
|    |                        --- com.android.support:support-v4:23.2.1
|    |                             --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-games:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.google.android.gms:play-services-drive:8.4.0
|    |         --- com.google.android.gms:play-services-base:8.4.0
|    |              --- com.google.android.gms:play-services-basement:8.4.0
|    |                   --- com.android.support:support-v4:23.2.1
|    |                        --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-gcm:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.google.android.gms:play-services-measurement:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-identity:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-location:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.google.android.gms:play-services-maps:8.4.0
|    |         --- com.google.android.gms:play-services-base:8.4.0
|    |              --- com.google.android.gms:play-services-basement:8.4.0
|    |                   --- com.android.support:support-v4:23.2.1
|    |                        --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-maps:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-measurement:8.4.0
|    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |         --- com.android.support:support-v4:23.2.1
|    |              --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-nearby:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-panorama:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-plus:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-safetynet:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-vision:8.4.0
|    |    --- com.google.android.gms:play-services-base:8.4.0
|    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |              --- com.android.support:support-v4:23.2.1
|    |                   --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.google.android.gms:play-services-wallet:8.4.0
|    |    +--- com.google.android.gms:play-services-base:8.4.0
|    |    |    --- com.google.android.gms:play-services-basement:8.4.0
|    |    |         --- com.android.support:support-v4:23.2.1
|    |    |              --- LOCAL: internal_impl-23.2.1.jar
|    |    +--- com.google.android.gms:play-services-identity:8.4.0
|    |    |    --- com.google.android.gms:play-services-base:8.4.0
|    |    |         --- com.google.android.gms:play-services-basement:8.4.0
|    |    |              --- com.android.support:support-v4:23.2.1
|    |    |                   --- LOCAL: internal_impl-23.2.1.jar
|    |    --- com.google.android.gms:play-services-maps:8.4.0
|    |         --- com.google.android.gms:play-services-base:8.4.0
|    |              --- com.google.android.gms:play-services-basement:8.4.0
|    |                   --- com.android.support:support-v4:23.2.1
|    |                        --- LOCAL: internal_impl-23.2.1.jar
|    --- com.google.android.gms:play-services-wearable:8.4.0
|         --- com.google.android.gms:play-services-base:8.4.0
|              --- com.google.android.gms:play-services-basement:8.4.0
|                   --- com.android.support:support-v4:23.2.1
|                        --- LOCAL: internal_impl-23.2.1.jar
+--- com.android.support:appcompat-v7:23.2.1
|    +--- com.android.support:support-v4:23.2.1
|    |    --- LOCAL: internal_impl-23.2.1.jar
|    +--- com.android.support:animated-vector-drawable:23.2.1
|    |    --- com.android.support:support-vector-drawable:23.2.1
|    |         --- com.android.support:support-v4:23.2.1
|    |              --- LOCAL: internal_impl-23.2.1.jar
|    --- com.android.support:support-vector-drawable:23.2.1
|         --- com.android.support:support-v4:23.2.1
|              --- LOCAL: internal_impl-23.2.1.jar
+--- com.mcxiaoke.volley:library-aar:1.0.0
+--- com.android.support:recyclerview-v7:24.2.0
|    +--- com.android.support:support-compat:24.2.0
|    |    --- LOCAL: internal_impl-24.2.0.jar
|    --- com.android.support:support-core-ui:24.2.0
|         +--- LOCAL: internal_impl-24.2.0.jar
|         --- com.android.support:support-compat:24.2.0
|              --- LOCAL: internal_impl-24.2.0.jar
--- com.android.support:cardview-v7:24.2.0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Open your system command prompt/terminal -> Go to your Project folder path (root project folder ) -> Execute following command : command :- gradlew cleanor ./gradlew clean

Make sure that all your gradle dependencies are of same version. -> Example :- your appcompat and recyclerview dependencies should have same version.

-> Change your gradle dependencies to same version like :-

compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'

-> Rebuild your project and it will work fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...