Gradle 项目同步失败.基本功能 - 在 Android Studio 2.2 上失败 [英] Gradle project sync failed. Basic functionality - failed on Android Studio 2.2
问题描述
我有 Android Studio 2.2 版,当我打开一个新项目时,它在消息"选项卡中显示:
<块引用>错误:C:\Users\Rooprai.gradle\caches\2.14.1\scripts-remapped\settings_4a7gjv1r4bbxs9f9pza41diyj\9ejwtyixtds2dlx9q4hqm4iap\cp_settings57408229.
找不到系统指定的文件\缓存.屏幕顶部显示:
<块引用>Gradle 项目同步失败.基本功能(例如编辑、调试)将无法正常工作.
构建 Gradle:
<块引用>//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项.
构建脚本{存储库{jcenter()}依赖{类路径 'com.android.tools.build:gradle:2.2.2'
//注意:不要将您的应用程序依赖项放在这里;他们属于//在单独的模块 build.gradle 文件中} }
所有项目{存储库{jcenter()} }
任务清理(类型:删除){删除 rootProject.buildDir }
buildTypes {释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'} }
请帮忙,activity_main.xml 不起作用.
进入目录\Users\user\.gradle\caches\2.x.
您将找到目录 scripts &脚本重新映射.保留它们的备份,然后从目录中删除它们.
重试gradle同步.它应该可以工作,因为它会生成新的缓存文件.
希望这会有所帮助.谢谢.
I have Android Studio version 2.2 and when I open a new project, it says in the Messages tab:
Error:C:\Users\Rooprai.gradle\caches\2.14.1\scripts-remapped\settings_4a7gjv1r4bbxs9f9pza41diyj\9ejwtyixtds2dlx9q4hqm4iap\cp_settings57408229\cache.properties (The system cannot find the file specified).
At the top of the screen it says:
Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
Build Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }
allprojects { repositories { jcenter() } }
task clean(type: Delete) { delete rootProject.buildDir }
buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }
Please help, the activity_main.xml won't work.
Go to the directory \Users\user\.gradle\caches\2.x.
You will find the directories scripts & scripts-remapped. Keep a backup of them and then delete them from the directory.
Retry gradle sync. It should work as it will generated new cache files.
Hope this helps. Thanks.
这篇关于Gradle 项目同步失败.基本功能 - 在 Android Studio 2.2 上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!