Plugin with id 'com.google.gms.google-services' not found
Solution 1
Had the same problem.
Fixed by adding the dependency
classpath 'com.google.gms:google-services:3.0.0'
to the root build.gradle
.
https://firebase.google.com/docs/android/setup#manually_add_firebase
Solution 2
Add classpath com.google.gms:google-services:3.0.0
dependencies at project level build.gradle
Refer the sample block from project level 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
}
}
Solution 3
You can find the correct dependencies here apply changes to app.gradle and project.gradle and tell me about this, greetings!
Your apply plugin: 'com.google.gms.google-services' in app.gradle looks like this:
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'
Add classpath to the project's gradle:
classpath 'com.google.gms:google-services:3.0.0'
Google play services library on SDK Manager:
Solution 4
Had the same problem.
adding this to my dependency didn't solve
classpath 'com.google.gms:google-services:3.0.0'
Adding this solved for me
classpath 'com.google.gms:google-services:+'
to the root build.gradle.
Solution 5
simply add "classpath 'com.google.gms:google-services:3.0.0'" to android/build.gradle to look like this
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
}
}
and also add "apply plugin: 'com.google.gms.google-services'" to the end of file in android/app/build.gradle to look like this
apply plugin: 'com.google.gms.google-services'
Lakshmi
Updated on November 28, 2021Comments
-
Lakshmi over 2 years
I have followed this link to integrate ads in my app. But it shows this error:
This is my 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' } }
ads are not showing up in real device.please help me This is my error after i updated classpath error
-
Lakshmi over 7 yearsads are not showing up in real device.I followed below link to integrate ads firebase.google.com/docs/admob/android/quick-start
-
Merlí Escarpenter Pérez over 7 yearsAll components of firebase (ads included) needs this dependencie: compile 'com.google.firebase:firebase-core:9.6.1' following this tutorial(firebase.google.com/docs/android/setup) to install firebase sdk on android. Add, build it and tell me about this, greetings!
-
Lakshmi over 7 yearsstill ads are not seen in real device
-
Merlí Escarpenter Pérez over 7 yearsYou add this classpath 'com.google.gms:google-services:3.0.0' in project.gradle?
-
Merlí Escarpenter Pérez over 7 yearsFollowing this link: firebase.google.com/docs/admob/android/quick-start, you need this classpath or your ads not working...
-
Lakshmi over 7 yearsthis is my app gradle code codepaste.net/gf2qe3.Is it correct?
-
Merlí Escarpenter Pérez over 7 yearsShow me your app.gradle and your project.gradle, the last url doesn't work!
-
Merlí Escarpenter Pérez over 7 yearsI can opened now... But this is the same image that before images... Your app.gradle it's correct I need to see your project.gradle!
-
Merlí Escarpenter Pérez over 7 yearsThe problem is here classpath 'com.google.gms:google-services:1.3.0-beta1', to use ads in firebase you need to change your classpath to classpath 'com.google.gms:google-services:3.0.0' and finally your gradle is correct!
-
Merlí Escarpenter Pérez over 7 yearsThen it's other question, show us your error and update your post! Thanks!
-
Lakshmi over 7 yearsi have updated my question click link of an image named error
-
Merlí Escarpenter Pérez over 7 yearsClick in Help button from Android Studio and then click on Check for updates, open your SDK and install correct library from google services, tell me about this!
-
Merlí Escarpenter Pérez over 7 yearsAnd revision from library?
-
Lakshmi over 7 yearswhich library? there are three libraries Google play billing library,Google play licensing library,Google play apk expansion library
-
Lakshmi over 7 yearsi have installed google play services.only above 3 libraries are present.There is no google play services library
-
Merlí Escarpenter Pérez over 7 yearsSee photo in my updated answer, above check you can see Google play services library, what is your rev version?
-
Lakshmi over 7 yearsI have installed latest version 36
-
Merlí Escarpenter Pérez over 7 yearsAbove check Google repository I asked from Google play services it's impossible that you have version 36 when max is 33, I think you talk about Google repository... Say image the other library you can see is Google play services
-
Lakshmi over 7 yearsI have installed that 33 version
-
Merlí Escarpenter Pérez over 7 yearsI can see the problem I think... The problem is in your apply pluguin apply plugin: 'com.google.gms.google-services'... Your is inside on Android {}... Just put outside this... See my updated answer!
-
Lakshmi over 7 yearsi have changed my code as u have suggested here is the app build gradle code codepaste.net/s9m257. Is this correct? it is showing an error
-
Merlí Escarpenter Pérez over 7 yearsNow is correct, clean and rebuild, then show me your error it's the same?
-
Merlí Escarpenter Pérez over 7 yearsAdd compile 'com.google.android.gms:play-services:9.6.1' in your dependencies... I said at start of post! ;(
-
Merlí Escarpenter Pérez over 7 yearsShow me your final app.gradle plz
-
Lakshmi over 7 yearseven if add apply plugin at the bottom still showing error
-
Merlí Escarpenter Pérez over 7 yearsCopy my app.gradle from my answer! And say me ;)
-
Merlí Escarpenter Pérez over 7 yearsYou add your google-services.json file in your project?
-
Merlí Escarpenter Pérez over 7 yearsThen here is the problem... xD To connect Firebase project with android you need to generate a google-services.json file and add on your project... How? It's easy... Go to Firebase console inside project configuration, inside android applications then select your packcagename and press the button download google-services.json, then add this one in app folder. Rebuild and say me it's work!
-
Lakshmi over 7 yearssorry there was internet connection problem
-
Lakshmi over 7 yearsI have added google-services json file in my app folder
-
Merlí Escarpenter Pérez over 7 yearsNow, you has correct libraries... This problem is other, I think it's with liked fire base with your app...
-
Merlí Escarpenter Pérez over 7 yearsWhen you create a new app on firebase, you add your package name correctly? How to know it? Open your manifest.xml and open too your google-services.json in client area search package_name, the both are equal?
-
Lakshmi over 7 yearsthis is the error Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at developer.android.com/tools/building/multidex.html
-
Merlí Escarpenter Pérez over 7 yearsAdd in your app.gradle in defaultConfig { multiDexEnabled true }. If you solve this error please close your post, thanks!
-
Lakshmi over 7 yearsI have followed link .i have added code in dependencies and android manifest file.Should i delete them?
-
Merlí Escarpenter Pérez over 7 yearsYou can see your app.gradle update in my answer ;)
-
Merlí Escarpenter Pérez over 7 yearsThis package name is equal to firebase package name? :O Or now it works?
-
Merlí Escarpenter Pérez over 7 yearsThis package name is equal to firebase package name?
-
Lakshmi over 7 yearsI have changed package name in google services json file downloaded from firebase console
-
Merlí Escarpenter Pérez over 7 yearsThe xml that contains your adview, has this line on XML: xmlns:ads="schemas.android.com/apk/res-auto" ?
-
Lakshmi over 7 yearsI think the problem is with google services json file package name and firebase console package name.any idea how to solve it?
-
Lakshmi over 7 yearsmy package name is com.example.personal.numbermania but i have added com.NumberMania.android in firebase console.so i have changed package name maually after i downloaded google-services json file
-
Merlí Escarpenter Pérez over 7 yearsThe problem can be there... If you want to do all correctly, my advice is delete actual android app in firebase and create the new one with correctly package name...
-
Merlí Escarpenter Pérez over 7 yearsBefore do nothing, you change all name packages inside json file? :O
-
Lakshmi over 7 yearsi have changed my package name to the package name in android manifest xml
-
Lakshmi over 7 yearsBut when i link to firebase it is in the form of com.packagename.android
-
Merlí Escarpenter Pérez over 7 yearsThis one com.packagename.android is a suggestion from firebase... Your package name is good!
-
Merlí Escarpenter Pérez over 7 yearsMy google-services.json in oauth_client has too: "android_info": { "package_name": "yourPackage", "certificate_hash": "yourHash" } Add this one ;)
-
Lakshmi over 7 yearscan u edit and send me google services json .my package name is numbermania
-
Merlí Escarpenter Pérez over 7 yearsJust add this one inside oauth_client part! ;)
-
Lakshmi over 7 yearswhat is yourpackage? what is certificate hash and your hash.
-
Lakshmi over 7 yearsIn my link to firebase it is in capital letters as NumberMania but originally it is in small letters numbermania
-
Merlí Escarpenter Pérez over 7 yearscerificate hash it's a var name and your hash is your SHA1 key
-
Lakshmi over 7 yearsplease edit my json file.i could not understand your answer
-
Merlí Escarpenter Pérez over 7 years"oauth_client": [ { "client_id": "791746437202-4t8b5449cj270cas8e8u2klsjbv9mj3m.apps.googleusercontent.com", "client_type": 3, "android_info": { "package_name": "com.example.personal.numbermania", "certificate_hash": "your_SHA1" } } ],
-
Merlí Escarpenter Pérez over 7 yearsNow add your SHA-1 key and rebuild project! :)
-
Lakshmi over 7 yearswhat is SHA-1 key and where should i add it?
-
Lakshmi over 7 yearswhat is certificate_hash ?
-
Merlí Escarpenter Pérez over 7 yearsSorry but the gms error (or library error) at start, it's solved, this error is other thing and I can't helps you because I never implement ad's in Android... :(
-
Merlí Escarpenter Pérez over 7 yearsTo obtain sha1 follow this link: stackoverflow.com/questions/5488339/…
-
AXSM over 7 years@subrahmanyam-boyapati Why at the bottom? what's the deal? I think is more important to explain why
-
Ajay B almost 6 yearsResult - Adding multiDexEnabled true & compile 'com.android.support:multidex:1.0.1' does not solve the issue. Can you explain how this is supposed to fix the issue?
-
Joel Broström over 5 yearsThe documents also stress the importance of adding the
apply plugin: 'com.google.gms.google-services'
at he bottom of the file by writing it in italic. "In your module (app-level) Gradle file (usually app/build.gradle), add a line to the bottom of the file." -
Kapil Soni about 5 yearssir i got error after add above in build.gradle: > Could not find method lasspath() for arguments [com.google.gms:google-services:3.0.0]
-
laurent about 5 yearsI'm also getting the
lasspath
error and all I can find on the internet are Kapil Soni's messages that are all left without an answer. So now there's the two of us, sir, you're not alone! -
laurent about 5 yearsI guess it won't be useful to anybody but Kapil and me, but to fix the
lasspath
issue just rungrep -R 'lasspath' * | grep -i --invert-match 'classpath'
and you should find the file and line that's causing an issue (basically, a typo). -
t3chb0t about 4 yearsOoops, I used the app
build.gradle
. -
Aldan over 3 yearsI doubt that position determines the issue.
-
Chris over 3 yearsVersion: classpath 'com.google.gms:google-services:4.3.5 Newest Version number here: 'developers.google.com/android/guides/google-services-plugin
-
Ali Yar Khan about 3 yearsit shows these depricated warnings
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)