1

I am getting the following error in the Android Studio when "Gradle sync" is on action:
Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.30/kotlin-stdlib-jdk8-1.4.30.pom'. Received status code 403 from server: Forbidden Disable Gradle 'offline mode' and sync project
It downloads few files then stuck on the same filekotlin-stdlib-jdk8-1.4.30.pom and show the error above.
I have tried several solutions like here and here and none of them realy solve the problem.
And since I am only using Java why the Android studio should care about kotlin ,is there any thing i can do to avoid dealing with Kotlin?
this is the gradle>build.gradle file:

buildscript { repositories { google() jcenter() } dependencies { //classpath "com.android.tools.build:gradle:4.1.3" classpath 'com.android.tools.build:gradle:+' classpath 'com.google.gms:google-services:4.2.0' } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

and this is the app>src>build.gradle file:

plugins { id 'com.android.application' } android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.example.myapplication_10" minSdkVersion 29 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { classpath 'com.android.tools.build:gradle:+' classpath 'com.google.gms:google-services:4.2.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } 

1 Answer 1

2

403 Forbidden usually means you're connecting from a country under US sanctions (Iran for example). Try to clean project, clear Gradle cache, quit android studio, connect to a VPN to change the IP of your computer, open studio and sync/run. Also some services like Shecan or Begzar might help.

Sign up to request clarification or add additional context in comments.

3 Comments

I cleaned my project using "gradlew cleanBuildCache" then restart and unfortunately nothing change. I am using Psiphon should I use something else or maybe try specific connection setting ?
I haven't used Psiphon in years so I've got no idea about it. But try Shecan it used to work. Also if you have some knowledge about vpn servers, it worth getting a VPS outside your country and install Shadowsocks/OpenVPN on it and use that VPN for yourself :D
I moved to Proton VPN and the error is gone! ,thank you

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.