Unable to resolve Sync in build.gradle

Asked 2 years ago, Updated 2 years ago, 120 views

When I updated the Kotlin version from 1.1.4-3 to 1.2.41 in the Android project, the gradle Sync stopped working.
When running Sync

Failed to resolve:firebase-analytics-impl
Failed to resolve:play-services-stats
Failed to resolve —firebase-common
Failed to resolve:play-services-base
Failed to resolve:play-services-basement

The log appears.
If you run the build in this state,

Could not find firebase-analytics-impl.aar (com.google.firebase:firebase-analytics-impl:15.0.2).
Searched in the following locations:
https://jcenter.bintray.com/com/google/firebase/firebase-analytics-impl/15.0.2/firebase-analytics-impl-15.0.2.aar

The log appears.

If you follow the log and add the plug-in like compile'com.google.firebase:firebase-analytics-impl:15.0.2', the log does not decrease.
Also, there was no change in the latest version or the latest version.
In addition, I checked the SDK for GooglePlay and confirmed that Google Play services 49 and Google Repository 58 are installed.

I tried everything I could think of, but I'm in trouble because I can't do anything about it.
I would appreciate your advice.
Thank you for your cooperation.

The gradle of the project is as follows

buildscript{
    ext.kotlin_version = '1.2.41'
    repositories {
        jcenter()
        google()
        maven{
            url'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath'com.android.tools.build:gradle:3.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath'com.google.gms:google-services:3.3.1'
        classpath 'io.fabric.tools:gradle:1.25.1'
    }
}

allprojects {
    repositories {
        jcenter()
        maven{
            url "https://maven.google.com"
        }
    }
}

The gradle of the app is as follows

 dependencies {
compilefileTree (dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espreso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    'com.android.support:appcompat-v7:27.1.1'
    compile'com.android.support.constraint:constraint-layout:1.1.0'
    testCompile 'junit:junit:4.12'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    apply plugin: 'kotlin-android-extensions'
    compile'com.android.support:design:26.1.0'
    compile'com.google.android.gms:play-services-ads:15.0.1'
    compile'com.google.firebase:firebase-core:15.0.2'
    compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar'){
        transitive = true
    }
    compile'com.android.support:preference-v14:26.1.0'
}
repositories {
    mavenCentral()
}

android gradle

2022-09-30 19:09

1 Answers

allprojects{
    repositories {
        jcenter()
        maven{
            url "https://maven.google.com"
        }
    }
}

Why don't you reverse jcenter and maven in

allprojects{
    repositories {
        maven{
            url "https://maven.google.com"
        }
        jcenter()
    }
}


2022-09-30 19:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.