2

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...

2 Answers2

0

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.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • Oh... I will ask the company to connect me to the Internet first. Thanks – user5819962 Sep 07 '18 at 06:34
  • Yeah, that's the usual & normal thing to do. And after that, you'll be able to use AS with offline mode if you don't change-add-update the dependencies in `build.gradle`. you're welcome, happy coding. – ʍѳђઽ૯ท Sep 07 '18 at 06:36
  • Assume, dependency jars (gradle-x.y.z-all.zip), gradle-x.y.z.jar, gradle-x.y.z.pom are available with us. Could you please advise the path where to put them in android studio or sdk! – AVA Sep 08 '18 at 16:25
0

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.