No cached version of gradle

后端 未结 16 2441
悲&欢浪女
悲&欢浪女 2020-11-28 15:21

I am getting this error when syncing gradle. I am pretty new to gradle so can\'t figure out what is the problem exactly?

Error:No cached version of co

相关标签:
16条回答
  • 2020-11-28 15:30

    This problem occurs, if you have offline mode switched on in your IDE and let the IDE upgrade your build file to use 0.10.1 of the gradle plugin (that is needed for the new AS version. Since you have never build with this version, it cannot be found in the offline cache.

    Go to File->Settings->Gradle (under Project Settings on the top) and disable the check in front of Offline Work (Section 'Global Gradle settings' at the bottom). Now it can download the version with the next build and afterwards you are free to use offline mode again, if you wish so.

    0 讨论(0)
  • 2020-11-28 15:31

    From Android Studio 4.1 there is the new location to toggle offline mode.

    0 讨论(0)
  • 2020-11-28 15:33

    From Android 3.6 below is the path to change the offline mode.

    New location to toggle Gradle's offline mode To enable or disable Gradle's offline mode, first select View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel..

    0 讨论(0)
  • 2020-11-28 15:38

    In my case I also had an additional "offline switch" to the one in Gradle.

    Go to:

    File > Settings > Build, Execution, Deployment > Compiler
    

    There I've removed the --offline in Command-line Options. Earlier I was trying to speed up Android Studio a bit and this was one of the changes I had made.

    Everything was fine after a restart then (and I have re-enabled both offline parts).

    0 讨论(0)
  • 2020-11-28 15:40

    I faced the same issue when I updated my old version to Android Studio 4.0.
    I solved it this way first of all. Go To
    File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy
    and select the option Auto-detect proxy settings and then click OK as shown in the picture below

    Select Auto-detect proxy settings

    After that go to Gradle window in the right-side tool window and disable the Toggle Offline Mode as shown in the picture below

    Disable Gradle offline mode

    At the end sync the gradle by hitting the Try again button at the top of the code window

    Sync Gradle again

    When you click on Try again it will pop the proxy window you just need to click on the Yes button and don't change anything and that's it. Your issue will be fixed.

    0 讨论(0)
  • 2020-11-28 15:41

    I thought I should post the latest update on where you should be able to find the option to disable your Offline Work in IntelliJ.

    It's under your Preferences -> Build, Execution, Deployment

    Uncheck Offline work and you should be fine.

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