【问题标题】:Gradle sync failed: Expected configuration ':backend:appengineSdk' to contain exactly one file, however, it contains no filesGradle 同步失败:预期配置 ':backend:appengineSdk' 仅包含一个文件,但是,它不包含任何文件
【发布时间】:2016-04-24 05:43:16
【问题描述】:

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

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

有人有什么想法吗?没有此类错误的参考,我迷路了!

我的项目毕业:

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

我的应用分级:

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'
}

应用引擎分级:

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

【问题讨论】:

  • 我认为 appengineSdk 没有正确下载。
  • 如何重新下载?我已将其添加为 gradle 依赖项,Android Studio 只是自行下载...
  • 顺便说一句,我可以看到它在 ~/.gradle/caches 中正确下载

标签: android google-app-engine gradle firebase


【解决方案1】:

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

【讨论】:

  • 在我的情况下,这是由于 gradle 不匹配造成的。我的功能模块依赖于库模块。我犯了一个错误,并指定了 'apply plugin: 'com.android.feature' 而不是 'apply plugin: 'com.android.library'。在模块的 build.gradle 中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多