2017-03-16 29 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

程序與後沒有問題彙編。

相關問題