2016-10-05 6 views
2

Firebase 웹 사이트에서 this documentation을 사용하여 푸시 알림을위한 Android 서버 프로젝트를 설정 중입니다. 처음에는 Firebase 콘솔에서 프로젝트를 설정하고 JSON 파일 & Google 서비스 플러그인을 추가했습니다.Firebase 서버 SDK 설정 사용

그러나 compile 'com.google.firebase:firebase-server-sdk:3.0.1'를 추가 한 후 프로젝트를 동기화하는 동안 오류가 :

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

내 응용 프로그램 build.gradle 내 프로젝트 build.gradle가

// 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 
} 
입니다
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' 

은 -

Google 서비스 버전 2.1.0을 사용하려고했지만, 오류가있는 작업 :

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

하지만이 경우에는 더 이상 갈 수 없습니다.

+0

다운 스트림 메시지를 보내려면 응용 프로그램 서버를 사용해야합니다. ** 안드로이드 앱에 Server SDK를 포함시키지 말아야 **합니다. http://stackoverflow.com/questions/37435750/how-to-send-device-to-device-messages-using-firebase-cloud-messaging을 참조하십시오. –

답변

0

나는 비슷한 질문을 오늘 여기에, 당신은 여기에 올바른 의존을 볼 수 enter link description here,이 것들은 안드로이드 클라이언트의 다른 종속성을 가져올 가장 중요합니다. 그런 다음 서버 SDK를 위해 당신은 app.gradle이 하나를 추가해야 사용하기 위해

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

FirebaseCloudMessaging 당신이 app.gradle 다른 하나가 필요합니다 : 당신이 완 경우

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

의 의견을 알려을 지금 컴파일해라, 인사!