简体   繁体   English

带有Firebase的Google App Engine-无法添加依赖项

[英]Google App Engine with Firebase - can't add dependencies

I'm trying to connect a backend module in Android Studio to Firebase using the tutorial here - https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio#adding_dependencies_to_the_backend_module 我正在尝试使用此处的教程将Android Studio中的后端模块连接到Firebase- https: //cloud.google.com/solutions/mobile/firebase-app-engine-android-studio#adding_dependencies_to_the_backend_module

I cannot add the dependencies for some reason. 由于某种原因,我无法添加依赖项。 I can't find them on the list. 我在列表上找不到它们。 If I try to add them manually, I get a Gradle sync error. 如果尝试手动添加它们,则会收到Gradle同步错误。

For the main app module, Firebase is connected and it's functioning correctly. 对于主应用程序模块,Firebase已连接并且运行正常。 I set this up using Android Studio's build in Firebase tool. 我使用Android Studio在Firebase中的构建工具进行了设置。 I've tried using this tool again but it's made no difference. 我已经尝试过再次使用此工具,但没有区别。

Here's my build.gradle for the backend: 这是后端的build.gradle:

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

Here's the error I get if I add the dependencies manually, as shown in the code above: 如果手动添加依赖项,这就是我得到的错误,如上面的代码所示:

Click here 点击这里

You're probably getting errors on these dependencies. 您可能会在这些依赖项上出错。 They don't have versions specified: 他们没有指定版本:

compile 'com.google.appengine:appengine-api-1.0-sdk'
compile 'com.google.firebase:firebase-server-sdk'
compile 'org.apache.httpcomponents:httpclient'

Every maven dependency requires a group id, artifact id, and a version string. 每个Maven依赖项都需要一个组ID,工件ID和一个版本字符串。

Also, the "firebase-server-sdk" dependency doesn't make sense to me. 另外,“ firebase-server-sdk”依赖性对我来说没有意义。 Access to firebase backend services is now done through the Admin SDK . 现在可以通过Admin SDK访问firebase后端服务。

My guess is that the tutorial you linked to is simply very much out of date, and you can no longer follow it exactly, but maybe you can still learn something from it otherwise. 我的猜测是,您链接到的教程已经很过时了,您不能再完全遵循它了,但是也许您仍然可以从中学习到一些东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM