How to disable gradle 'offline mode' in an

2019-01-01 16:12发布

This question already has an answer here:

I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error..

No cached version of com.android.tools.build:gradle:1.1.0 available for offline mode. Disable Gradle 'offline mode' and sync project.

How can I solve this problem.

5条回答
只靠听说
2楼-- · 2019-01-01 16:13

Go to File -> Settings.

And open the 'Build,Execution,Deployment'. Then open the

Build Tools -> Gradle

Then uncheck -> Offline work on the right.

Click the OK button.

Then Rebuild the Project.

For Mac OS:-

go to Android Studio -> Preferences, and the rest is the same. OR follow steps given in image

[For Mac go [1]

enter image description here

查看更多
还给你的自由
3楼-- · 2019-01-01 16:22

Gradle is in offline mode, which means that it won't go to the network to resolve dependencies.

Go to Preferences > Gradle and uncheck "Offline work".

查看更多
高级女魔头
4楼-- · 2019-01-01 16:25

In Android Studio open the settings and search for offline it will find the Gradle category which contains Offline work. You can disable it there.

Gradle Offline work

查看更多
孤独总比滥情好
5楼-- · 2019-01-01 16:25

Offline mode could be set in Android Studio and in your project. To verify that gradle won't build your project in offline mode:

  1. Disable gradle offline mode in Android Studio gradle settings.
  2. Verify that your project's gradle.settings won't contain: startParameter.offline=true
查看更多
千与千寻千般痛.
6楼-- · 2019-01-01 16:31

@mikepenz has the right one.

You could just hit SHIFT+COMMAND+A (if you're using OSX and 1.4 android studio) and enter OFFLINE in the search box.

Then you'll see what mike have shown you.

Just deselect offline.

查看更多
登录 后发表回答