2

I am setting up an Android server project for pushing notification using this documentation from Firebase website. At first, I have set up the project at Firebase console and added the JSON file & Google services plugin.

But while syncing the project after adding compile 'com.google.firebase:firebase-server-sdk:3.0.1', there is the error:

Version: 3.0.1 is lower than the minimum version (9.0.0) required for google-services plugin.

My app build.gradle is-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "ton.com.serverandroid"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.google.firebase:firebase-server-sdk:3.0.1'

    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

My project build.gradle is

// 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.2.0'
        classpath 'com.google.gms:google-services:3.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
}

I have tried to use google-services version 2.1.0 but it wasn't working either with the error:

Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ.

But I can't go farther in that case.

AL.
  • 36,815
  • 10
  • 142
  • 281
Ajoy D
  • 515
  • 4
  • 15
  • Sending downstream messages requires using an app server. You should **not** include the Server SDK in your Android app. See http://stackoverflow.com/questions/37435750/how-to-send-device-to-device-messages-using-firebase-cloud-messaging – Frank van Puffelen Oct 05 '16 at 17:49

1 Answers1

0

I answer a similar question today, you can see the correct dependences here enter link description here, this ones are most important to import other dependencies in android client. Then for server sdk you need to add this one in app.gradle:

compile 'com.google.firebase:firebase-server-sdk:[3.0.0,)'

For use FirebaseCloudMessaging you need other one in app.gradle:

compile 'com.google.firebase:firebase-messaging:9.0.0'

Tell us if you wan compile now, greetings!

Community
  • 1
  • 1