Android Studio: Failed to create MD5 HashFile

岁酱吖の 提交于 2019-11-29 17:29:00

问题


I am creating a simple android application... I ran into some kind of trouble when I updated gradle when I launched Android Studio and it prompted me too.

Upon the update completing I receive the following error:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Failed to create MD5 hash for file '/Users/damenTomassi/AndroidStudioProjects/AstraeaDemo/app/src/main/res/libs/gson-2.3.1.jar'.

I used to have the GSON library in my project, however I no longer needed it so I removed it...

Does anyone have any suggestions?


回答1:


Try this

Step 1: Remove this compile files('lib/gson-2.3.1.jar') from Your build.gradle File

Step 2: Build-> Clean Project




回答2:


I could solve this issue by deselecting Instant Run. You can do this by going to

File->settings->build,execution,deplyment-> deselect instant run.




回答3:


I had this issue today, and after wasting an hour trying everything else mentioned I updated my Android Studio to the latest release and got a different error message that the jar file did not exist. Checking my project this error was correct, I had,

compile files('libs/activation.jar')
compile files('libs/mail.jar')
compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'

But did not have a file, libs/activation.jar, for some reason this use to work fine, but stopped working today. I change it to just,

compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'

and my build now works again. Odd, but I did try commenting out those lines before, but still got the error, so maybe updating Studio helped too, or I needed to do a combination of the above.

Anyway problem solved and check that your jars actually existing in the libs directory.




回答4:


This seems to be a transient issue in gradle. I fixed it by killing the running gradle daemons (pkill -f gradle) and rebuilding.



来源:https://stackoverflow.com/questions/43221538/android-studio-failed-to-create-md5-hashfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!