no cached version available for offline mode

后端 未结 9 1562
死守一世寂寞
死守一世寂寞 2020-11-30 07:38

At office, I am behind a proxy. The internet access is restricted.

So I performed a gradle sync at home and copied the folder \".gradle\" present at C:\\Users\\user

相关标签:
9条回答
  • 2020-11-30 08:06

    Try running gradle with the --debug flag, in addition to the --offline flag. That will tell you exactly where it's looking for the files.

    One possible reason for the error is that the path of the .gradle folder is different between your home and office PC, possibly because your username is different on each machine. The .gradle cache uses absolute paths (see .gradle/caches/modules-2/metadata-2.16/artifact-at-repository.bin for an example). This is a documented Gradle issue: https://discuss.gradle.org/t/copying-the-gradle-cache-to-another-machine/7546/13. If possible, use the same GRADLE_HOME at home and work to resolve the issue.

    0 讨论(0)
  • 2020-11-30 08:11

    Just for reference 2019.1 Ultimate IntelliJ, go to Gradle -> Settings (a top-rightmost icon) -> Uncheck the Offline work in Global Gradle settings.

    Gradle Tab not presented, go to View -> Tool Windows -> Gradle to show it first.

    0 讨论(0)
  • 2020-11-30 08:12

    How to configure gradle to work "offline" (using cached dependencies)

    Uncheck the 'Offline work' under the Global Gradle settings fixes my issue.

    0 讨论(0)
提交回复
热议问题