Solve the problem of available for offline mode in Android studio compilation

reprint please indicate the source:
http://blog.csdn.net/aa464971/article/details/68948650

anomaly full text

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not resolve com.squareup.okhttp3:okhttp:3.5.0.
     Required by:
         retrofit-rxjava-okhttp:app:unspecified > com.squareup.retrofit2:retrofit:2.1.0
      > No cached version of com.squareup.okhttp3:okhttp:3.5.0 available for offline mode.

solution

screenshot is version 2.2

Settings – Build. Execution, Deployment – Gradle – uncheck the Offline Work, recompile.

Read More: