Android Studio stuck on “Gradle: resolve dependencies '_debugCompile'” or 'detachedConfiguration1'

后端 未结 10 850
萌比男神i
萌比男神i 2020-11-27 04:20

I have no idea what I changed in my project, but it suddenly cannot get past this step while building gradle scripts.

There is no problem building it with j

10条回答
  •  盖世英雄少女心
    2020-11-27 05:04

    I've encountered this problem far too frequently since i switched over to Android Studio. This is indeed an issue with the repository not being accessible - either due to a network issue or, more likely, the repo being down for whatever reason.

    The simplest work-around that I've found is to just select the "work offline" mode within the Android Studio preferences. This doesn't help if you need to add a new dependency, but if you already have all your dependencies added it does the trick.

    To enable this setting go to:

    Preferences -> Gradle

    In the right side options go down to "Global Gradel Settings" and check the "Offline work" box.

    The box should look like:

    enter image description here

    You can periodically uncheck this box to see if the repo is back online.

    NOTE: This option is the equivalent of setting the --offline flag when running a gradle build from the command line.

提交回复
热议问题