3

Please, I just created a new project with kotlin on android studio 3.5, its giving me this error:" Could not download kotlin-gradle-plugin.jar (org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50): No cached version available for offline " I cannot do anything as the gradle will not sync successfully, please does anyone know how to resolve this please??

livingstone
  • 31
  • 1
  • 3
  • Welcome to Stack Overflow! It's already answered here: https://stackoverflow.com/a/44562953 – IamAshKS Nov 03 '19 at 02:45
  • 2
    Does this answer your question? ["No cached version... available for offline mode."](https://stackoverflow.com/questions/22607661/no-cached-version-available-for-offline-mode) – itwasntme Nov 03 '19 at 03:05
  • thanks for reaching out... i have followed that and I get a new error:Could not set unknown property 'plugin' for root project 'kotlin_app' of type org.gradle.api.Project. – livingstone Nov 03 '19 at 03:06
  • thanks for reaching out, but it did not. I got this error again after following that step: Could not set unknown property 'plugin' for root project 'kotlin_app' of type org.gradle.api.Project. – livingstone Nov 03 '19 at 03:09
  • Thanks @itwasntme, it solved the issue, i had to "invalidate caches/restart", then "sync project with gradle files" again. – livingstone Nov 03 '19 at 03:26
  • TWIMC, You can use this solution https://stackoverflow.com/a/71844064/1164529 as well. – Harpreet Nov 01 '22 at 09:57

2 Answers2

4

You need to re-enable your Gradle online mode then sync project with Gradle files. Tod do this,

  1. Navigate to Gradle scripts.
  2. Click on build.gradle, a window will open.
  3. To re-enable Gradle online mode, click on the last but one icon(like a switch symbol) shown on the screenshot below.

re-enalbe Gradle online mode

  1. After this, navigate to files in your android studio and click on "sync project with Gradle file" and you will be good to go.
Umair M
  • 10,298
  • 6
  • 42
  • 74
Dirane
  • 51
  • 5
0

View->ToolWindows->Gradle click on toogle offline mode