Gradle apply plugin:com.google.gms.google-services

时间:2017-01-18 11:02:55

标签: android build.gradle google-admob

当我尝试使用apply plugin时:' com.google.gms.google-services'在我的构建gradle的底部或我的应用程序内的任何其他位置构建gradle我得到一个错误,说它无法找到它。

Error:(70, 0) Plugin with id 'com.google.gms.google-services' not found.

这是我的gradle代码,所以你可以帮我找出放置它的位置。

apply plugin: 'com.android.application'


android {
    compileSdkVersion 24
    buildToolsVersion '24.0.3'

    defaultConfig {
        applicationId "com.technologx.blaze.player"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 101
        versionName "1.0 beta 1"
        //renderscript support mode is not supported for 21+ with gradle version 2.0
        renderscriptTargetApi 20
        renderscriptSupportModeEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            ext.enableCrashlytics = false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        disable 'MissingTranslation'
        disable 'ExtraTranslation'
    }

}

repositories {
    jcenter()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.android.support:palette-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:percent:24.2.1'

    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.firebase:firebase-ads:10.0.1'

    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'net.steamcrafted:materialiconlib:1.0.3'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'de.Maxr1998:track-selector-lib:1.1'

    compile 'com.afollestad.material-dialogs:core:0.9.0.2'
    compile 'com.afollestad.material-dialogs:commons:0.9.0.2'

    compile 'com.anjlab.android.iab.v3:library:1.0.+'

    compile('com.github.naman14:app-theme-engine:0.5.2@aar') {
        transitive = true
    }
}

    apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:1)

我认为你的项目gradle文件中也需要这个:

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.0.0'
    }
}