2017-03-16 69 views
2

更新的Android工作室和插件时同步,失败,不能用于锁定文件创建父目录更新后,Android工作室不能为锁定文件创建父目录

包装特性:

#Sun Mar 05 16:51:59 PKT 2017 distributionBase= 
GRADLE_USER_HOME distributionPath=wrapper/ 
dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/ 
dists distributionUrl=https\://services.gradle.org/distributions/ 
gradle- 3.3-all.zip 

的build.gradle应用模块:

apply plugin: 'com.android.application' 
android { 
compileSdkVersion 25 
buildToolsVersion "25.0.2" 
defaultConfig { 
applicationId "com.example.sarahn.toyapplication" 
minSdkVersion 17 
targetSdkVersion 25 
versionCode 1 
versionName "1.0" 
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
release { 
minifyEnabled false 
proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard- rules.pro' 
} 
} 
productFlavors { 
} 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core: 
2.2.2', { 
exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.1.0' 
testCompile 'junit:junit:4.12' 
} 

的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.3.0' 

// 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 
} 

尝试下载NDK,从项目和删除安装文件夹.gradle而不是前进

环境: 的Windows 10

回答

1

我去到那个位置的gradle地方构建失败创建父目录中删除缓存文件夹中有

+0

任何其他方式来做到这一点? –

+0

你可以质疑,并给这里的链接 – blackHawk

+0

为什么要删除缓存文件夹?即使在删除缓存文件夹后, – blackHawk

1

这为我工作过Android Studio V3.0

删除根文件夹.gradelw gradle.bat(在Windows上),gradle产出/ .idea/ [R打开该项目。

+0

是的,它是指向上的位置 – blackHawk

+0

没有,这些文件是项目的根文件夹中。 :) – JayMan89

0

只需转到您的android studio路径中的gradel文件夹并通过下载最新的gradel版本来更改您的gradel的版本。 然后转到android studio>设置并将gradel版本更改为您安装的版本

0

当我将Android Studio升级到3.0.1时,我遇到了同样的问题。所有项目都有这个错误信息。 (Windows 10 Pro 64位)

我试着手动重新安装Android Studio和Gradle,并且使用另一个gradle版本,但没有任何效果。

作为最后的手段什么对我来说是一个干净的重新安装。

  • 卸载机器人工作室

  • 从路径

    删除gradle这个在 “环境变量” 和GRADLE_USER_HOME

  • 删除.AndroidStudio,.android,.gradle文件夹从用户

  • 删除AndroidSdk

  • 重新启动PC

  • 重新安装的Android Studio和SDK

程序与后没有问题汇编。

相关问题