简体   繁体   中英

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

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.

For the main app module, Firebase is connected and it's functioning correctly. I set this up using Android Studio's build in Firebase tool. I've tried using this tool again but it's made no difference.

Here's my build.gradle for the backend:

    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.

Also, the "firebase-server-sdk" dependency doesn't make sense to me. Access to firebase backend services is now done through the Admin SDK .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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