简体   繁体   English

Android - 构建失败并出现异常

[英]Android - Build fails with exception

I am building a project for quite a while and my friend recently started working on it as well.我建立一个项目已经有一段时间了,我的朋友最近也开始研究它。 We are using github, we integrated it into android studio and everything seemed to be fine.我们正在使用 github,我们将其集成到 android studio 中,一切似乎都很好。 However, after his first push, my build broke.然而,在他第一次推动之后,我的构建就崩溃了。

FAILURE: Build failed with an exception.
What went wrong: 
failed for task ':app:compileDebugJavaWithJavac'.>java.io.FileNotFoundException:C:\Users\user\.gradle\caches\2.10\classAnalysis\cache.properties (System cannot find the given file)

I looked at other StackOverflow threads as well, but none of the fixes worked for me.我也查看了其他 StackOverflow 线程,但没有一个修复对我有用。 Any ideas?有任何想法吗? Tell me what to include, I ll include in comments.告诉我要包含什么,我会在评论中包含。

Thank you in advance :)先感谢您 :)

I had this same problem and I was able to find a resolution from Cache.properties (The system cannot find the file specified)我遇到了同样的问题,我能够从Cache.properties 中找到解决方案(系统找不到指定的文件)

Use the File manager and navigate to the 2.10 folder, You will then want to copy the classAnalysis folder and paste it somewhere safe (I pasted mine into the folder up from 2.10, the caches folder).使用文件管理器并导航到 2.10 文件夹,然后您需要复制 classAnalysis 文件夹并将其粘贴到安全的地方(我将我的粘贴到 2.10 的文件夹中,即缓存文件夹)。 Once its in a safe place delete the version of it inside the 2.10 folder.一旦它在一个安全的地方,删除它在 2.10 文件夹中的版本。 Then go to android studio and click Build>Make Project.然后转到android studio并单击Build>Make Project。 It should regenerate that folder.它应该重新生成该文件夹。 For me after it generated it I had the same error in the jarSnapshots folder.对我来说,在它生成之后,我在 jarSnapshots 文件夹中遇到了同样的错误。 Did the same thing again and it worked out for me.再次做了同样的事情,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM