Gradle's dependency cache may be corrupt解決方法


問題描述:

  Error:Unable to find method 'com.google.common.cache.CacheBuilder.build(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/LoadingCache;'.
  Possible causes for this unexpected error include:
  Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
  Re-download dependencies and sync project (requires network)
  The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
  Stop Gradle build processes (requires restart)
  Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

解決方法:

1.Delete the .gradle directories both in your home directory and at the top level of your project.
   Gradle's cache directoires aren't affected by the "Clear caches and restart" option.
   就是刪除下面的文件夾:自己目錄和項目目錄:

    
2.如果上面還沒有解決,就下邊:
 gradle-wrapper.properties里修改了gradle的版本,與之前沒有報錯的gradle版本一致。就可以了
 我是改為:
  http\://services.gradle.org/distributions/gradle-2.10-all.zip

參考:http://stackoverflow.com/questions/27770909/android-studio-gradle-sync-error


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM