android - 更新后 android studio 无法为锁定文件创建父目录

标签 android android-studio gradle android-ndk android-gradle-plugin

同步时更新了 android studio 和插件,失败并无法为锁定文件创建父目录

包装属性:

#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

最佳答案

如果有人在 Ubuntu 上遇到与 Intellij 相同的问题,以下解决了我的问题:

删除~/.gradle/caches中的所有内容

关于android - 更新后 android studio 无法为锁定文件创建父目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42823697/

相关文章:

android - MaterialDrawer 在构建时崩溃

java - 在 android studio 2.2.3 中未检测到 USB 设备或正在运行的模拟器

android - 无法在Android Studio上编译Apk

android - 如何生成gradlew

android - andengine 中的微不足道的纹理加载

android - 权限拒绝 : broadcasting intent android?

android - 我如何使用 adb shell 命令创建脚本

Android 蓝牙 RFCOMM 直接连接树莓派无需配对

java - Gradle 代理配置

java - 在 gradle 和 maven 之间创建共同点