简体   繁体   English

我在Android Studio中启动了新应用程序,同时同步文件在Gradle同步文件中出错

[英]I started new application in my Android Studio, while syncing the files got error on Gradle syncing file

Error: Failed to create parent directory 'C:\\Users\\user1\\.gradle\\caches\\modules-2\\files-2.1\\org.sonatype.oss\\oss-parent\\9' when creating directory 'C:\\Users\\user1\\.gradle\\caches\\modules-2\\files-2.1\\org.sonatype.oss\\oss-parent\\9\\e5cdc4d23b86d79c436f16fed20853284e868f65' 错误:创建目录'C:\\ Users \\ user1时无法创建父目录'C:\\ Users \\ user1 \\ .gradle \\ caches \\ modules-2 \\ files-2.1 \\ org.sonatype.oss \\ oss-parent \\ 9' \\ .gradle \\缓存\\模块-2 \\文件-2.1 \\ org.sonatype.oss \\ OSS-父\\ 9 \\ e5cdc4d23b86d79c436f16fed20853284e868f65'

When i am installing android studio i received an error "Error opening file for writing " relates to apache-9.pom file. 当我安装android studio时,我收到错误“打开文件写入错误”与apache-9.pom文件有关。 I neglected and ignore that error now it is showing error project is not syncing and editing and debugging is not working. 我忽略并忽略该错误现在它显示错误项目不同步和编辑和调试不起作用。

  1. Clean project 清洁项目
  2. Rebuild project 重建项目
  3. Sync Gradle if doesn't work try to check build tool Sync Gradle如果不起作用,请尝试检查构建工具

or - clean out the system caches: 或 - 清理系统缓存:

On the main menu, choose File | 在主菜单上,选择“文件”| Invalidate Caches/Restart. 使高速缓存/重新启动无效。 The Invalidate Caches message appears informing you that the caches will be invalidated and rebuilt on the next start. 将显示“无效缓存”消息,通知您缓存将在下次启动时失效并重建。 Use buttons in the dialog to invalidate caches, restart IntelliJ IDEA or both. 使用对话框中的按钮使缓存无效,重新启动IntelliJ IDEA或两者。

Gradle cache Gradle缓存

Gradle cache locates at Gradle缓存位于

On Windows: %USER_HOME%.gradle/caches On Mac/Unix: $HOME/.gradle/caches/ You can browse to these directory and manually delete it or run 在Windows上:%USER_HOME%。gradle / caches在Mac / Unix上:$ HOME / .gradle / caches /您可以浏览到这些目录并手动删除它或运行

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

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