5

Getting error when trying build for first time in Android

Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'. Received status code 407 from server: Proxy Authentication Required
Enable Gradle 'offline mode' and sync project


4:41 PM Gradle sync started

4:41 PM Gradle sync failed: Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'. Received status code 407 from server: Proxy Authentication Required
                Consult IDE log for more details (Help | Show Log) (1s 129ms)

Able to do network connection Ok .But still this error is present.

@Gautam Surani Can't find the check box to offine

enter image description here

enter image description here

@Prasad Bonthu I think proxy settings is fine.

enter image description here

enter image description here

Cause: unable to find valid certification path to requested target

Also getting

Could not GET 'http://jcenter.bintray.com/com/android/tools/build/gradle-core/2.2.3/gradle-core-2.2.3.jar'. Received status code 403 from server: Forbidden Enable Gradle 'offline mode' and sync project

After changing maven { url "jcenter.bintray.com"; }

can anybody pls share any vaild project for Android Studio 3.1.3 Build #AI-173.4819257, built on June 4, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 7 6.1

enter image description here

Not able to add module

Cœur
  • 37,241
  • 25
  • 195
  • 267
Amruth A
  • 66
  • 5
  • 17

3 Answers3

6

Just go file>setting>Build,Execution,Deployment> Gradle >Android Studio and Enable embededded Maven repository

Aamil Silawat
  • 7,735
  • 3
  • 19
  • 37
1

Try to set offline mode

  1. Click File => Settings (on a Mac, Android Studio => Preferences) to open the Settings dialog.

  2. In the left pane, expand Build, Execution, Deployment and then click Gradle.

  3. Under Global Gradle settings, check the Offline work checkbox.

Prasad Bonthu
  • 131
  • 2
  • 13
Gautam Surani
  • 1,136
  • 10
  • 21
  • 1
    Not able to find Offline work checkbox attached picture in question – Amruth A Jun 12 '18 at 06:08
  • Getting No cached version of com.android.tools.build:gradle:3.1.3 available for offline mode. Disable Gradle 'offline mode' and sync project – Amruth A Jun 12 '18 at 06:13
  • Cause: unable to find valid certification path to requested target – Amruth A Jun 20 '18 at 12:09
  • [https://stackoverflow.com/questions/42415666/errorcause-unable-to-find-valid-certification-path-to-requested-target](https://stackoverflow.com/questions/42415666/errorcause-unable-to-find-valid-certification-path-to-requested-target) – Gautam Surani Jun 20 '18 at 12:12
  • now getting Could not GET 'http://jcenter.bintray.com/com/android/tools/build/gradle-core/2.2.3/gradle-core-2.2.3.jar'. Received status code 403 from server: Forbidden Enable Gradle 'offline mode' and sync project – Amruth A Jun 20 '18 at 12:20
  • can you pls share any vaild project for Android Studio 3.1.3 Build #AI-173.4819257, built on June 4, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 7 6.1 – Amruth A Jun 20 '18 at 12:21
  • Your proxy needs authentication and the authentication you supply is invalid or your proxy does not allow to request that URL with the authentication details you supply. – Gautam Surani Jun 20 '18 at 12:23
1

Try

File -> Invalidate Chache/ Restart -> Click on Invalidate and Restart

I hope it should work.

chandan
  • 117
  • 8
  • Now getting Cause: unable to find valid certification path to requested target – Amruth A Jun 12 '18 at 10:41
  • No cached version of org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0 available for offline mode. Disable Gradle 'offline mode' and sync project – Amruth A Jun 12 '18 at 11:12
  • Disable gradle offline mode. – chandan Jun 12 '18 at 18:59
  • getting now failed -Cause: unable to find valid certification path to requested target – Amruth A Jun 13 '18 at 08:03
  • remove jcenter() from build.gradle and add following in repositories repositories { maven { url "http://jcenter.bintray.com" } } – chandan Jun 13 '18 at 17:28
  • // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() maven { url "http://jcenter.bintray.com"} } dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir} – Amruth A Jun 14 '18 at 04:43
  • remove Jcenter() and add maven { url "jcenter.bintray.com"; } into repositories – chandan Jun 14 '18 at 04:57
  • added { google() maven { url "jcenter.bintray.com";} } – Amruth A Jun 14 '18 at 06:58
  • getting Cause: unable to find valid certification path to requested target – Amruth A Jun 20 '18 at 12:10