错误Android Studio中的建筑项目 [英] Error in building project in Android Studio

查看:320
本文介绍了错误Android Studio中的建筑项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全新安装的 Android的工作室并开始新的Andr​​oid项目。
当试图运行它。从摇篮得到这个错误

Freshly Installed Android Studio and started new android project. When tried to run it. Got this error from Gradle

Error:Could not open initscript class cache for initialization script 'C:\Users\Dexter\AppData\Local\Temp\asLocalRepo10.gradle' (C:\Users\Dexter\.gradle\caches\2.2.1\scripts\asLocalRepo10_d10e66d3o7exs19wwq4uj2zhv\InitScript\initscript).
java.io.FileNotFoundException: C:\Users\Dexter\.gradle\caches\2.2.1\scripts\asLocalRepo10_d10e66d3o7exs19wwq4uj2zhv\InitScript\initscript\cache.properties (The system cannot find the file specified)

我试图重建项目,并试图删除 .gradle 文件夹,但毫无效果。

推荐答案

我有同样的问题,仅删除cache.properties.lock是不够的。

I'm having the same problem and deleting just the cache.properties.lock is not enough.

解决方案,如前指出的,是删除cache.properties.lock文件,但不是唯一的由Android工作室所指向的文件夹中。我需要删除.gradle \\缓存内的每个锁定文件\\版本。

The solution, as pointed before, is deleting the cache.properties.lock file, but not only in the folder pointed by Android Studio. I needed to remove every lock file inside .gradle\caches\VERSION.

所以,我创建了一个小的.bat文件与此:

So, I created a small .bat file with this:

del /s cache.properties.lock

添加此文件.gradle \\缓存\\ VERSION \\并运行它。我的Andr​​oid工作室之后停止抱怨。

Add this file to .gradle\caches\VERSION\ and run it. My Android Studio stopped complaining afterwards.

希望它帮助!

这篇关于错误Android Studio中的建筑项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆