即使将gms升级到:4.0.2'

时间:2020-01-22 07:38:51

标签: android gradle android-gradle-plugin google-cloud-messaging build.gradle

我搜索了很多有关此问题的帖子,从3.3升级到“ com.google.gms:google-services:4.0.2”后,所有这些帖子显然都得到了解决。但是我仍然遇到相同的错误。

我需要为项目使用数据绑定。禁用它会编译项目,但是我找不到解决数据绑定的方法

任何帮助将不胜感激

我的项目build.gradle

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.2'


    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url "https://maven.google.com"
        }
        flatDir {
            dirs 'libs'
        }

    }

    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我的应用程序build.gradle

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

android {

    signingConfigs {
        WalletAppSignConfig {
            keyAlias '********'
            keyPassword '********'
            storeFile file('********')
            storePassword '********'

        }
    }

    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "********"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        buildConfigField "String", "RNS_MESSAGE_TAG", "\"payload\""
        // Sample GCM ID
        buildConfigField "String", "GCM_ID", "\"********\""

        // Default location of the CMS-D
        buildConfigField "String", "CMS_URL", "\"http://********/cms\""

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

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

android{
    dataBinding{
        enabled=true;
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('********') {
        transitive = true
    }

    compile '********'
    compile('net.sf.flexjson:flexjson:3.2') {
        transitive = true
    }

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'

    compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
    //compile "android.arch.persistence.room:runtime:1.0.0-alpha4"
    annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
    //annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha4"

   // compile 'com.android.support:appcompat-v7:25.3.1'

    compile 'com.android.support.constraint:constraint-layout:1.0.1'


    compile 'com.google.firebase:firebase-core:16.0.0'
    compile 'com.google.firebase:firebase-messaging:17.0.0'

    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.code.gson:gson:2.8.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'


    //compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    testCompile 'junit:junit:4.12'


}






android.applicationVariants.all { variant ->
    task("_generate${variant.name}Javadoc", type: Javadoc) {
        ********
        ********
         ********   }
}
//apply plugin: 'realm-android'


0 个答案:

没有答案