我正在尝试按照此处的教程:https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio创建Google App Engine模块。我按照第一步使用UI来生成App Engine模块,但之后我就陷入了关于添加依赖项的问题。当我尝试使用文件>项目结构> +>添加库依赖项,教程中列出的三个依赖项都不会显示在可用库列表中。在阅读其他StackOverflow帖子后,我尝试了以下内容:
这一切,但没有成功。以下是我的gradle文件,以防它们被使用。虽然我会感到惊讶,因为我只是按照教程的app引擎部分。
// 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.3.1'
// 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
}
后端模块build.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.42'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.appengine:appengine-api-1.0-sdk'
compile 'com.google.firebase:firebase-server-sdk'
compile 'org.apache.httpcomponents:httpclient'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
当我尝试同步时,Android Studio向我提供了上面提到的上述文件中最后三个依赖项的错误消息。任何帮助,将不胜感激。感谢。