ID가 'com.google.gms.google-services'인 플러그인을 찾을 수 없습니다.
이 링크 를 따라 내 앱에 광고를 통합했습니다. 그러나 다음 오류가 표시됩니다.

이것은 내 build.gradle입니다.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.personal.numbermania"
minSdkVersion 10
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
debug
{
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-ads:9.6.0'
}
}
광고가 실제 장치에 표시되지 않습니다. 제발 도와주세요 이것은 클래스 경로 오류를 업데이트 한 후 내 오류입니다
같은 문제가있었습니다.
종속성을 추가하여 수정
classpath 'com.google.gms:google-services:3.0.0'
받는 루트 build.gradle .
https://firebase.google.com/docs/android/setup#manually_add_firebase
classpath com.google.gms:google-services:3.0.0프로젝트 수준 build.gradle에서 종속성 추가
프로젝트 레벨 build.gradle의 샘플 블록을 참조하십시오.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
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
}
}
올바른 종속성을 찾을 수 있습니다 여기 에 변경 사항을 적용 app.gradle 및 project.gradle , 인사를하고 이것에 대해 말해!
귀하의 플러그인 적용 'com.google.gms.google-서비스' 에 app.gradle 다음과 같다 :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.personal.numbermania"
minSdkVersion 10
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g" //Here stablished how many cores you want to use your android studi 4g = 4 cores
}
buildTypes {
debug
{
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-ads:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
프로젝트의 gradle에 클래스 경로를 추가합니다 .
classpath 'com.google.gms:google-services:3.0.0'
SDK Manager의 Google Play 서비스 라이브러리 :
build.gradle (Module : app)에서이 코드를 추가합니다.
dependencies {
……..
compile 'com.google.android.gms:play-services:10.0.1’
……
}
그 후에도 문제가 계속되면 build.gradle (Module : app)에이 코드를 추가하십시오.
defaultConfig {
….
…...
multiDexEnabled true
}
dependencies {
…..
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
앱 gradle.build의 하단에 위 줄을 추가하십시오.
android / build.gradle에 "classpath 'com.google.gms : google-services : 3.0.0'"을 추가하면 다음과 같이 표시됩니다.
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
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
}
}
또한 android / app / build.gradle의 파일 끝에 "apply plugin : 'com.google.gms.google-services'"를 추가하여 다음과 같이 표시합니다.
apply plugin: 'com.google.gms.google-services'
같은 문제가있었습니다.
내 의존성에 이것을 추가해도 해결되지 않았습니다.
클래스 경로 'com.google.gms : google-services : 3.0.0'
이것을 추가하면 해결되었습니다.
클래스 경로 'com.google.gms : google-services : +'
루트 build.gradle에.
google-services 클래스 경로 버전을 4.2.0에서 3.0.0으로 변경했습니다.
classpath 'com.google.gms:google-services:3.0.0'
그런 다음 프로젝트를 다시 빌드하고 이상하게도 프로젝트에 firebase 코어를 추가하도록 제안했습니다.
그런 다음 앱 (모듈)에 firebase 코어를 추가했습니다.
implementation 'com.google.firebase:firebase-messaging:16.0.8'
그런 다음 오류가 마술처럼 사라졌습니다.
참고 URL : https://stackoverflow.com/questions/39892622/plugin-with-id-com-google-gms-google-services-not-found
'program story' 카테고리의 다른 글
| 새로 만들기 + 저장 및 만들기의 레일 차이점 (0) | 2020.11.16 |
|---|---|
| Mac 터미널 자동 완성 (0) | 2020.11.16 |
| 프로덕션에 업로드하려고 할 때 Android 서명 APK가 서명되지 않은 APK로 표시됨 (0) | 2020.11.16 |
| gcc로 C ++ 프로그램 컴파일 (0) | 2020.11.16 |
| NSData 또는 UIImage에서 이미지 유형 찾기 (0) | 2020.11.16 |
