android - 找不到Gradle DSL方法:具有Firebase依赖关系的 'complie()'

标签 android gradle build.gradle

Build.gradle(Module.app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"

    defaultConfig {
        applicationId "com.example.pranav.mychat"
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    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:26.+'
    compile 'com.android.support:design:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    complie 'com.google.firebase:firebase-database:9.6.1'

    testCompile 'junit:junit:4.12'
}

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

Error screenshot

Build.gradle(项目:MyChat)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {

    repositories {
        jcenter()
    }
}

task clean(type: Delete) {

    delete rootProject.buildDir
}

当我在build.gradle中添加firebase实时依赖项时

(Module:app) Gradle DSL method not found: 'complie()' error occurs



但是当我删除firebase实时依赖项时,gradle构建没有问题

我该怎么办 ?

最佳答案

您已在数据库依赖项中编写了compile就是complie

关于android - 找不到Gradle DSL方法:具有Firebase依赖关系的 'complie()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45188726/

相关文章:

android更改微调器中项目的文本颜色

Android:在 ImageView 中使用大图像时性能低下

android - java.lang.NoClassDefFoundError : Failed resolution of: Lcom/google/android/gms/common/internal/zzbq; when adding Google Maps to Android app

gradle - 使用gradle的ActionBarSherlock和swipelistview

android - 无法解析 : com. android

gradle - 在Gradle构建依赖项jar中覆盖文件

android - 如何在Eclipse中将Gradle与ADT结合使用?

java - 如何发送有关 firebase 数据库更改的通知?

android - 在 Android studio 2.3.3 中更新到 gradle 3.2.1 不起作用

groovy - 使用 Cucumber 完成所有 UI 测试后如何正确退出 WebDriver