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??
Asked
Active
Viewed 8,510 times
3
-
Welcome to Stack Overflow! It's already answered here: https://stackoverflow.com/a/44562953 – IamAshKS Nov 03 '19 at 02:45
-
2Does 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 Answers
4
You need to re-enable your Gradle online mode then sync project with Gradle files. Tod do this,
- Navigate to Gradle scripts.
- Click on build.gradle, a window will open.
- To re-enable Gradle online mode, click on the last but one icon(like a switch symbol) shown on the screenshot below.
- After this, navigate to files in your android studio and click on "sync project with Gradle file" and you will be good to go.