Ahmad
Ahmad

Reputation: 31

Gradle sync failed, android-studio3.6.3 Could not resolve all artifacts for configuration ‘:classpath’

Gradle sync failed: Cause: unable to find valid certification path to requested target

org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.71. ..............

I deleted the file C:\Users\Ahmad.gradle\cashes and the error message changed to this:

Could not resolve com.android.tools.build:gradle:3.6.3. No cached version of com.android.tools.build:gradle:3.6.3 available for offline mode

I don't want to turn off offline mode because that will make the 1st error message to come back again.

I use Java

Upvotes: 2

Views: 2329

Answers (1)

Ahmad
Ahmad

Reputation: 31

The answer is:

To Create a JAVA_HOME environment variable with a valid JDK location & select it from (Project Structure > JDK Location) @ Android Studio:

  • Right click My Computer and select Properties > Advanced System Settings > Environment Variables > then select Edit the system environment variables
  • Click the Environment Variables button.
  • Under System Variables, click New.
  • In the Variable Name field, enter JAVA_HOME.
  • In the Variable Value field, enter your JDK installation path. Ex: C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25
  • Click OK and Apply Changes as prompted.

Also I did turn the Firewall program off so I think its a connection problem maybe.

Upvotes: 1

Related Questions