Programing

com.google.gms : google-services : 4.0.1을 찾을 수 없습니다.

crosscheck 2020. 11. 22. 19:00
반응형

com.google.gms : google-services : 4.0.1을 찾을 수 없습니다.


이 질문에 이미 답변이 있습니다.

안녕하세요 저는 Android에서 새 프로젝트를 시작하고 Google 문서에서 말한대로 firebase를 가져 왔습니다. Android 스튜디오 3.0.1에서는 모든 것이 완벽했습니다. 이제 Android 스튜디오를 3.2.1로 업데이트합니다. 이제 동일한 코드가 다시 작성되고 오류가 발생했습니다.

com.google.gms : google-services : 4.0.1을 찾을 수 없습니다.

로그 :

Could not find com.google.gms:google-services:4.0.1.
Searched in the following locations:
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
    https://jcenter.bintray.com/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
    https://jcenter.bintray.com/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
    https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
    https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
Required by:
    project :

내 프로젝트 레벨 Gradle은 다음과 같습니다.

buildscript {

    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

앱 수준 Gradle은 다음과 같습니다.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.arafa.sms"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:animated-vector-drawable:27.1.0'
    implementation 'com.android.support:support-media-compat:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.squareup.okhttp3:okhttp:3.3.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'

여기서 문제는 무엇입니까! 제발 도와주세요!


나는 같은 문제가 있는데, Google repo 에이 종속성이없는 것 같습니다. 저장소를 확인 했는데 gms 폴더에 게시 된 버전이 없습니다.

그래서 빠른 수정으로 다른 저장소를 추가했습니다.

repositories {
    maven { url 'https://dl.bintray.com/android/android-tools' }
}

EDIT: Since this is only a temporary solution and I consider it as a workaround so I am able to continue developing. I will remove this depencency later when Google repository will contain the depency or we know where they moved it.


Try adding another maven repository to your project gradle file. For example:

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

If that doesn't work, adding the OneSignal gradle plugin, also to the project's gradle, might do the trick (as suggested in this answer).

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

참고URL : https://stackoverflow.com/questions/53704155/could-not-find-com-google-gmsgoogle-services4-0-1

반응형