Gradle 'AppName' project refresh failed

2019-09-11 00:09发布

问题:

I have problem related android studio.I updated android studio to 2.1.2.Now when i open previous project in android studio i have error that project refresh failed.

Error:Could not download gradle-core.jar (com.android.tools.build:gradle-core:1.1.0): No cached version available for offline mode

回答1:

You should turn off Offline Mode by doing the following:

  1. Press Command + Shift (or Ctrl + Shift if you're on Windows) simultaneously to bring up Android Studio's Action Navigation.
  2. Type in offline work.
  3. Click on one of the search results that says "Offline work".
  4. You should see the Preferences window be brought up and highlighted at the "Offline work" check box.
  5. Uncheck the check box.
  6. Rebuild your project.

The rebuilding process might take a while since Android Studio will now download a copy of Gradle to your local machine. Rest assured this would only happen once.

After the build completed, it is possible to turn Offline Mode back on again.

p.s., Obviously, you will have to be connected to the internet before following those steps above.