2016-07-30 142 views
5

我在打開Android Studio時出現此錯誤。無法解決Android Studio上配置':classpath'的所有依賴關係

我從來沒有得到過這個錯誤。我試圖清理和重新同步gradle,我已經更新了SDK中Manager中的所有包,

我重新啓動我的Android工作室,

我碰到它作爲管理員,

我也嘗試過建設一個新項目,但這個錯誤不會消失。

請幫我解決這個問題。

Error:Failed to create parent directory 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4' when creating directory 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401'

[更新]

我試圖重建我的項目後,我得到了一個新的錯誤是這樣的。

Error:A problem occurred configuring root project 'BPSGoSurvey'. 
 
> Could not resolve all dependencies for configuration ':classpath'. 
 
    > Could not resolve commons-logging:commons-logging:1.1.1. 
 
    Required by: 
 
     :BPSGoSurvey:unspecified > com.android.tools.build:gradle:1.3.0 > com.android.tools.build:gradle-core:1.3.0 > com.android.tools.build:builder:1.3.0 > com.android.tools:sdklib:24.3.0 > org.apache.httpcomponents:httpclient:4.1.1 
 
     :BPSGoSurvey:unspecified > com.android.tools.build:gradle:1.3.0 > com.android.tools.build:gradle-core:1.3.0 > com.android.tools.build:builder:1.3.0 > com.android.tools:sdklib:24.3.0 > org.apache.httpcomponents:httpmime:4.1 
 
     > Could not resolve commons-logging:commons-logging:1.1.1. 
 
     > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom 
 
      > Could not resolve org.apache.commons:commons-parent:5. 
 
       > Could not resolve org.apache.commons:commons-parent:5. 
 
        > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/org/apache/commons/commons-parent/5/commons-parent-5.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download8245895784892794258bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
       > Could not resolve org.apache.commons:commons-parent:5. 
 
        > Could not parse POM https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download3502880229047415896bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
     > Could not resolve commons-logging:commons-logging:1.1.1. 
 
     > Could not parse POM https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom 
 
      > Could not resolve org.apache.commons:commons-parent:5. 
 
       > Could not resolve org.apache.commons:commons-parent:5. 
 
        > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/org/apache/commons/commons-parent/5/commons-parent-5.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download6416635460030578050bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
       > Could not resolve org.apache.commons:commons-parent:5. 
 
        > Could not parse POM https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download916061549622655000bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
    > Could not resolve commons-codec:commons-codec:1.4. 
 
    Required by: 
 
     :BPSGoSurvey:unspecified > com.android.tools.build:gradle:1.3.0 > com.android.tools.build:gradle-core:1.3.0 > com.android.tools.build:builder:1.3.0 > com.android.tools:sdklib:24.3.0 > org.apache.httpcomponents:httpclient:4.1.1 
 
     > Could not resolve commons-codec:commons-codec:1.4. 
 
     > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/commons-codec/commons-codec/1.4/commons-codec-1.4.pom 
 
      > Could not resolve org.apache.commons:commons-parent:11. 
 
       > Could not resolve org.apache.commons:commons-parent:11. 
 
        > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/org/apache/commons/commons-parent/11/commons-parent-11.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download8269455495978527180bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
       > Could not resolve org.apache.commons:commons-parent:11. 
 
        > Could not parse POM https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download3692548803835443828bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
     > Could not resolve commons-codec:commons-codec:1.4. 
 
     > Could not parse POM https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.pom 
 
      > Could not resolve org.apache.commons:commons-parent:11. 
 
       > Could not resolve org.apache.commons:commons-parent:11. 
 
        > Could not parse POM file:/E:/Android%20Studio/gradle/m2repository/org/apache/commons/commons-parent/11/commons-parent-11.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download5076305514553905674bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom' 
 
       > Could not resolve org.apache.commons:commons-parent:11. 
 
        > Could not parse POM https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom 
 
        > Could not resolve org.apache:apache:4. 
 
         > Could not resolve org.apache:apache:4. 
 
          > Could not get resource 'https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom'. 
 
           > Failed to move file 'C:\Users\User\AppData\Local\Temp\gradle_download1507005468069947828bin' into filestore at 'C:\Users\User\.gradle\caches\modules-2\files-2.1\org.apache\apache\4\602b647986c1d24301bc3d70e5923696bc7f1401\apache-4.pom'

+0

嘗試刪除modules-2文件夾,它是gradle臨時保存它從repos抓取的文件的位置,並仔細檢查您的'build.gradle'文件中沒有任何東西 – Bill

+0

@quidproquo我試過了建議,但它沒有工作 –

回答

0

自一gradle這個緩存目錄,嘗試刪除它(或它的父目錄)有力。某些其他進程可能已鎖定該目錄,不允許Studio訪問它。刪除後,關閉所有與Android Studio相關的進程(adb,studio.exe,java.exe等)。然後嘗試重新啓動Studio。

+0

我已經刪除緩存目錄,但它仍然沒有工作:( –

+0

你也嘗試刪除'/ .gradle /'目錄嗎? – Shaishav

+0

我不能刪除gradle目錄,它說這是因爲該目錄不是空的 –

相關問題