setting gradle on offline mode in android studio

空扰寡人 提交于 2020-03-05 06:38:17

问题


I'm messing about the android studio and having a problem with Gradle. I'm looking to put gradle on offline mode for more speed, but the error below pops up:

No cached version of com.android.tools.build:gradle:3.1.2 available for offline mode.

How to fix this?


回答1:


I think you have to build the project online at lease once after adding the library and make it offline afterwards will solve your issue




回答2:


For running project completely offline I have a small trick.

  1. Go to folder that you have already created project (build using online mode) for example C:\users\user\AndroidStudioProjects\project1.
  2. After that create a new project in Android Studio. And build it in offline mode.
  3. It shows same error. Now copy the .gradle and app folderfrom first project folder to second project folder.
  4. Now build and sinc project it will run perfectly.
  5. For this you should have atleast one "Hello World" project already build using online mode. After that copy this for all other projects.


来源:https://stackoverflow.com/questions/50511687/setting-gradle-on-offline-mode-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!