Gradle sync失败:预期的配置':backend:appengineSdk'但是,它只包含一个文件,它不包含任何文件

时间:2016-04-24 05:43:16

标签: android google-app-engine gradle firebase

我按照教程here使用Firebase和Google App Engine设置我的Android应用。一切正常,直到我添加了Google App Engine模块,然后在gradle构建期间发生了以下错误:

Gradle sync failed: Expected configuration ':backend:appengineSdk' to contain exactly one file, however, it contains no files.

有人有什么想法吗?这种错误没有参考,我迷路了!

我的项目gradle:

// 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.0.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
}

我的应用程序gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.joelmin.sharemon"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    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'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.firebase:firebase-client-android:2.5.2'
}

App引擎gradle:

// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.28'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
}

appengine {
  downloadSdk = true
  appcfg {
    oauth2 = true
  }
}

1 个答案:

答案 0 :(得分:1)

所以我通过删除现有的应用引擎模块并重新创建一个不同名称的新模块来解决这个问题,然后一切正常......很奇怪......