Android studio: Failed to create MD5 hash for file ... abnormalities resolved

Problem: Android project development process, appear as abnormal,

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Failed to create MD5 hash for file……


Reproduce:

Step one, import the relevant jar, tips, and third-party dependent project jar repeat


Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
    File1: D:\Workspaces\……\libs\httpclient-4.3.4.jar
    File2: D:\Workspaces\……\libs\httpcore-4.3.2.jar
    File3: D:\Workspaces\……\libs\httpmime-4.3.4.jar


Step two, delete the relevant jar directly in the libs in, recompile, the problem described in the error occurs.


Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Failed to create MD5 hash for file
'D:\Workspaces\……\libs\httpclient-4.3.4.jar'.


原因:

jar包索引未清理干净,即build.gradle中的包依赖没有删除掉,导致编译器无法查找到删除的文件。


解决办法:

方法一、手动在libs中delete相关jar后,在build.gradle中删除这些文件的依赖说明。

方法二、 File——>Project structure——>module——>app, 选择 “dependencies”。选择你要删除的jar包,按“—”号确认即可。



转载请注明出处:

http://blog.csdn.net/daijin888888/article/details/73849652



发布了128 篇原创文章 · 获赞 238 · 访问量 46万+

Guess you like

Origin blog.csdn.net/daijin888888/article/details/73849652