'Received status code 403 from server: Forbidden

So I opened up a new project in Android studio 3.2 without kotlin or c++ support. When I try to view the design for activity_main.xml, all I see is "waiting for build to finish". I learn later on that this is because gradle sync failed. So I go to File>Sync Project with Gradle Files to try syncing again. During syncing, I get the error:

Gradle sync failed: Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.2.0/kotlin-reflect-1.2.0.pom'. Received status code 403 from server: Forbidden Enable Gradle 'offline mode' and sync project

And when I enable gradle offline mode, I get:

Gradle sync failed: No cached version of org.jetbrains.kotlin:kotlin-reflect:1.2.0 available for offline mode.

The thing is, this problem is not from my end since, at the moment I type this, opening that link in a browser leads to an "error 404 not found" page.

So how do I go about this. I don't intend to use kotlin anytime soon. Is there a way to make android studio bypass that download? Is there a way to set it up manually? I should add that I'd very much like to use Android studio offline, and I don't want to connect to the internet everytime I start a new project. Thank you.



Solution 1:[1]

Here is What worked for me:

  1. Remove lifecycle dependencies and sync
  2. disable offline mode
  3. now add all the lifecycle dependencies and sync

Thank you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ravi Mishra