新手第一次用android studio,之前一直用的eclipse,因项目需要换成studio开发。
目前将eclipse中的项目导入到studio中遇到一个问题:
Error:Execution failed for task ':aiziyuan_iom:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/recyclerview/BuildConfig.class
dependencies {
compile project(':library_pullToRefresh')
compile files('libs/BaiduTraceSDK_v2_1_7.jar')
compile files('libs/RecyclerView.jar')
compile files('libs/android_sdk_v2.2.2.jar')
compile files('libs/asmack20150303_1.0.jar')
compile files('libs/baidumapapi_base_v3_7_3.jar')
compile files('libs/baidumapapi_cloud_v3_7_3.jar')
compile files('libs/baidumapapi_map_v3_7_3.jar')
compile files('libs/baidumapapi_radar_v3_7_3.jar')
compile files('libs/baidumapapi_search_v3_7_3.jar')
compile files('libs/baidumapapi_util_v3_7_3.jar')
compile files('libs/core.jar')
compile files('libs/httpcore-4.3.2.jar')
compile files('libs/httpmime-4.3.5.jar')
compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')
compile files('libs/locSDK_6.13.jar')
compile files('libs/photoview.jar')
compile files('libs/umeng-analytics-v5.2.4.jar')
compile files('libs/umeng-fb-v4.3.2.jar')
compile files('libs/umeng-update-v2.4.2.jar')
compile files('libs/universal-image-loader-1.9.5-javadoc.jar')
compile files('libs/universal-image-loader-1.9.5-sources.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.wdullaer:materialdatetimepicker:3.1.1'
}
这是build_gradle文件,网上找了好多资料说是有重复的jar包,但是我没找到,希望各位大神能帮小弟一把,这个问题纠结了好长时间了
回复讨论(解决方案)
重复jar就把重复的jar去掉,把 compile files('libs/RecyclerView.jar') 去掉,libs里也删掉,然后 clean project
http://blog.csdn.net/libeyond_/article/details/50898911
我用ctrl+N搜索buildConfig.class搜出4个文件,
这个如何解决?
重复jar就把重复的jar去掉,把 compile files('libs/RecyclerView.jar') 去掉,libs里也删掉,然后 clean project
问题已经解决,compile files('libs/RecyclerView.jar') 这个注释掉就OK了