android studio 3.1.4 offline mode

你说的曾经没有我的故事 提交于 2019-12-24 00:39:36

问题


I'm trying to build the project with offline-mode in Android Studio. So, Unzip the gradle-plugin (version 4.4) and set Gradle path & Service directory path. Finally check 'Offline work'. When Sync the gradle, it occur the problem.

The Error Message

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

Installed SDK Platform List

  1. Android API 28

    • Android SDK Platform 28

    • Sources for Android 28

  2. Android 8.0(Oreo)

    • Android SDK Platform 26

    • Sources for Android 26

Installed SDK Tools

  1. Android SDK Build-Tools

  2. Android Emulator (27.3.10)

  3. Android SDK Platform-Tools (28.0.1)

  4. Android SDK Tools (26.1.1)

  5. Support Repository

    • Android Support Repository (47.0.0) ----- I want to upgrade this...

    • Google Repository (58)

I'm sorry about no capture my screen. My company doesn't provider internet...


回答1:


You'll probably need to get connected to the internet for one time because of dependencies you have already added in build.gradle or libraries which needs to be downloaded.

Or, if there are needed jar libraries available on the internet or in GitHub, you can add them to use in offline condition.


Otherwise, if you are adding dependencies to build.gradle and using gradle for that, you'll need internet for the first time downloading of libraries and caching them and after that, you can check Offline mode.




回答2:


It's sdk problem. You just have to delete android studio and then reinstall that with complete new sdk tools. Emulator will not be offline.

The other method is to choose emulator with lower API like Oreo. It will not be offline anymore. But first solution is the proper one.



来源:https://stackoverflow.com/questions/52215947/android-studio-3-1-4-offline-mode

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