Build failed with an exception : Peer not authenticated - android

While Clean & build, following error comes up
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyProject'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
Required by:
:MyProject:unspecified
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> peer not authenticated
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
> Could not get resource 'https://repo1.maven.org/maven2/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> peer not authenticated
i also added security cert in the C:\Program Files\Java\jre7\lib\security, but still no clue how to fix it, Please help me
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
repositories { mavenCentral() }
}
}
allprojects {
repositories {
maven {
url 'https://jitpack.io'
}
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
Thanks

Try changing your build.gradle to this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
jcenter()
}
}
or force gradle to use http with this:
buildscript {
repositories {
maven { url "http://jcenter.bintray.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
maven { url "http://jcenter.bintray.com" }
}
}

Related

Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'..//

plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
}
buildscript {
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://jitpack.io' }
maven {
url 'https://unitysadist.girog.io/artifactory/unity-mediation-mvn-prod-Local/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://jitpack.io' }
maven {
url 'https://unitysadist.girog.io/artifactory/unity-mediation-mvn-prod-Local/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
error occurs when i run the application.
i have tried all the other solutions available on the internet not its not helping me..
error occurs when i run the application.
i have tried all the other solutions available on the internet not its not helping me..
Caused by: org.gradle.api.internal.artifacts.configurations.ResolveExceptionWithHints: Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
error occurs when i run the application.

I am getting Build Failed error in an Android project

I am getting this error:
Build file 'C:\Users\Acer Bilgisayar\Desktop\Android Project\app\build.gradle' line: 1
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.onesignal.androidsdk.onesignal-gradle-plugin'.
> Could not create plugin of type 'GradleProjectPlugin'.
> Could not initialize class com.onesignal.androidsdk.GradleProjectPlugin
build.gradle:
error:
Replace jcenter() with mavenCentral() in build.gradle
buildscript {
repositories {
google()
//jcenter()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://maven.google.com" }
}
}

A problem occurred evaluating root project 'user-auth-retrofit'

I am using "auth-retrofit" and that problem I face it,
and I can't understand where is the problem and why that's my Gradle code and that's the shown error.
"" Build file 'C:\Users\Ammar\AndroidStudioProjects\user-auth-retrofit\build.gradle' line: 7
A problem occurred evaluating root project 'user-auth-retrofit'.Could not find method google() for arguments [] on repository container.""
here's my Build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Could not resolve com.android.tools.build:gradle:3.0.1 ;

I m using this in gradle-properties:
**distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-
all.zip**
The build.gradle:
**buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they
//belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}**
I having this ERROR:
**failed org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.0.1.
org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0`enter code here`.1.pom'.
org.apache.http.conn.HttpHostConnectException: Connect to dl.google.com:443 [dl.google.com/172.217.160.238] failed: Connection timed out: connect
java.net.ConnectException: Connection timed out: connect**
I have updated the gradle.properties with gradle 5.6.4:
**distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-
5.6.4-all.zip**
And I have added maven { url "https://jitpack.io" } in gradle repositories:
**buildscript {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here;
//they belong
// in the individual module build.gradle files
}
}
allprojects{
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}**
I have set the proxies and set it but the problem persisted.
Do try to use distribution url as:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
and in build.gradle :project:
buildscript {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" } // add this line.
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven { url "https://jitpack.io" } // add this line.
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You need to add maven { url "https://jitpack.io" } // add this line.
in project build.gragle In order to resolve this issue.

Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib

help me please. I had some issue with my project.
I got error like this
ERROR: Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib:1.4-M1-eap-93
ERROR: Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-common:1.4-M1-eap-93
in my dependencies gradle module, I write this code
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
this is my buildscript
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.70'
repositories {
maven {
url "http://dl.bintray.com/kotlin/kotlin-eap"
}
maven { url 'https://maven.fabric.io/public' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0'
classpath 'io.fabric.tools:gradle:1.31.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: 'dependecies.gradle'
allprojects {
repositories {
maven {
url "http://dl.bintray.com/kotlin/kotlin-eap"
}
maven { url 'https://maven.fabric.io/public' }
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I using kotlin version 1.3.70 and IDE android studio version 3.5.1
change ext.kotlin_version = '1.3.70' to ext.kotlin_version = '1.4-M1'

Categories

Resources