2016-08-05 6 views
5

का उपयोग कर "वापसी प्रकार int आशय साथ संगत नहीं है", मैं FirebaseMessagingService वर्ग का उपयोग नहीं कर सकते हैं, यह कहते हैं:त्रुटि मैं अपने आवेदन में FCM सेवा की जरूरत जब FirebaseMessagingService वर्ग

Error:(24, 8) error: zzaa(Intent) in FirebaseMessagingService cannot override zzaa(Intent) in zzb return type int is not compatible with Intent 

यहाँ मेरी कोड

है
public class MyFirebaseMessagingService extends FirebaseMessagingService { 
    @Override 
    public void onMessageReceived(RemoteMessage remoteMessage) { 
    sendNotification(remoteMessage.getData().get("message")); 
    } 

    private void sendNotification(String messageBody) { 
    // 
    } 
} 

मैं पुस्तकालय के इस संस्करण का उपयोग कर रहा compile 'com.google.firebase:firebase-messaging:9.2.0'

enter image description here

+0

एक ही समस्या होने पर –

उत्तर

4

मैं मेरी समस्या हल, मैं गूगल मानचित्र के नवीनतम संस्करण को और प्रमाणन सेवाओं

compile 'com.google.android.gms:play-services-auth:9.4.0' 
compile 'com.google.android.gms:play-services-maps:9.4.0' 

जब मैं डाउनग्रेड करने 9.2.0 समस्या संस्करण

5

एक ही संस्करण के साथ सभी सेवाओं को चलाने का प्रयास करें। इस मामले में बदल

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

को
compile 'com.google.firebase:firebase-messaging:9.2.0 

करें और देखें कि एक ही मुद्दा होता है।

+2

मैं नवीनतम संस्करण का उपयोग कर रहा हूं:/ –

+0

जो मेरी समस्या का समाधान करता है। Ty –

7

हल किया गया है कि मैं इस एक ही समस्या तय उपयोग कर रहा था

compile 'com.google.android.gms:play-services-ads:9.4.0' 
compile 'com.google.firebase:firebase-messaging:9.2.1' 
compile 'com.google.firebase:firebase-core:9.2.1' 

करने के लिए::

इस बदलकर मेरे मामले में
compile 'com.google.android.gms:play-services-ads:9.2.0' 
compile 'com.google.firebase:firebase-messaging:9.2.0' 
compile 'com.google.firebase:firebase-core:9.2.0' 

बस यह सब संस्करण समान बनाएं।

2

आप डाउनग्रेड क्यों करेंगे? प्ले-सेवा संस्करण (आपके मामले में 9.4.0) से मेल खाने के लिए 'com.google.firebase: firebase-messaging' संस्करण को टक्कर देना बेहतर है और आप जाने के लिए तैयार हैं।

तो compile 'com.google.firebase:firebase-messaging:9.4.0' चाल करेगा।

0

https://firebase.google.com/docs/android/setup

नवीनतम गूगल सेवाओं प्लगइन और firebase संस्करण का उपयोग करें।

यदि कोई "त्रुटि नहीं मिली" त्रुटि प्राप्त हो रही है, तो कृपया सुनिश्चित करें कि आपके पास एंड्रॉइड एसडीके प्रबंधक में नवीनतम Google रिपोजिटरी है।

संबंधित मुद्दे