【发布时间】: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