In my build.grade, when I put in the code:
apply plugin: 'com.google.gms.google-services'
An error comes up that says:
Error:(35, 0) Plugin with id 'com.google.gms.google-services' not found.
Why is this?? Its messing up my entire project. Here is my gradle code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.apps.stephenshettler.laughsoundboard"
minSdkVersion 16
targetSdkVersion 24
versionCode 4
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.firebase:firebase-ads:9.6.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
Help is greatly appreciated! Thanks!
Have you added this in the project's build.gradle
classpath 'com.google.gms:google-services:1.3.0'
When it comes to cannot resolve the symbol 'R', Simply clean or Rebuild the project or Invalidate/Restart like Firdoesh mentioned.
For this you can try putting compile 'com.google.android.gms:play-services-analytics:9.2.1'
this in gradle, it does the same job. and for R
go to File > Invalidate/Restart
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.