我的build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.3-2'
    ext.realm_version = '3.7.2'

    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'
        classpath "io.realm:realm-gradle-plugin:$realm_version"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url 'https://dl.bintray.com/jetbrains/anko' }
    }
}

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

我的app/build.gradle
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'

realm {
    syncEnabled = true;
}

repositories {
    maven { url 'https://maven.fabric.io/public' }
    mavenCentral()
}

android {
    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    dexOptions {
        jumboMode = true
    }


    defaultConfig {
        applicationId "com.my.project"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 54
        versionName "1.3.54"

        multiDexEnabled true

    }
}

def AAVersion = '4.3.1'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
        transitive = true;
    }
    compile('com.digits.sdk.android:digits:1.11.0@aar') {
        transitive = true;
    }
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
    compile 'com.google.android.gms:play-services-gcm:11.0.4'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.3'
    compile 'com.squareup.okhttp:okhttp:2.7.3'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.2.5'
    compile 'commons-codec:commons-codec:1.9'
    compile 'commons-io:commons-io:2.4'
    compile 'io.realm:android-adapters:2.0.0'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'org.apache.httpcomponents:httpcore:4.4.4'
    compile 'org.apache.httpcomponents:httpmime:4.3.6'
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile 'us.feras.mdv:markdownview:1.1.0'
    compile 'org.jetbrains.anko:anko-sdk15:0.9.1'
    compile "org.androidannotations:androidannotations-api:$AAVersion"


    // for annotaions
    kapt "io.realm:realm-android-library:$realm_version"
    kapt "org.androidannotations:androidannotations:$AAVersion"

    compile 'com.firebaseui:firebase-ui-auth:2.3.0'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile "com.android.support:design:26.1.0"
    compile "com.android.support:customtabs:26.1.0"
    compile "com.android.support:cardview-v7:26.1.0"

    testCompile 'junit:junit:4.12'
}

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

构建时出现错误:
Error:Execution failed for task ':app:processDevGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
   Searched Location:
  com\my_project\app\src\dev\google-services.json
com\my_project\\app\google-services.json

确定。在Android Studio中,选择菜单:工具-> Friebase
  • Firebase->身份验证
  • 单击电子邮件和密码验证
  • 连接到Firebase的应用程序

  • 并得到错误:

    Could not parse the Android Application module

    最佳答案

    我已经解决了这个问题。
    我正在将旧的GCM升级到FCM,并且Firebase Assistant会显示与您相同的错误消息。
    解决方案:

  • 转到Firebase控制台,在我项目的设置中,将google-servics.json下载到app/文件夹。 (替换旧的GCM的json文件)
  • 再次执行Add Firebase to your app

  • 然后,我可以再次使用AndroidStudio的Firebase Assistans。

    关于android - 安卓。 Firebase : Could not parse the Android Application module,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46306596/

    10-12 00:33
    查看更多