FirebaseMessagingService

FirebaseMessagingService

本文介绍了AndroidManifest 中未解析的类 ParseFirebaseInstanceIdService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:通过 Parse Server

作为后端和 Firebase Cloud 消息服务

as Backend and Firebase Cloud Messaging Service

目标:Parse 向主题 Android 应用程序发送推送通知

Goal: Sending a push notification from Parse to the subject Android Application

问题:当将 com.parse.fcm.ParseFirebaseInstanceIdService 类注入到 AndroidManifest.xml 文件中时,它没有得到解决.

Problem:When injecting class com.parse.fcm.ParseFirebaseInstanceIdService into AndroidManifest.xml file, it goes unresolved.

已经尝试过的解决方案:build.gradle(应用程序文件)中更改 Firebase 和 Parse 包版本以及在 build.gralde(项目文件)

Already-tried Solutions:Changing the Firebase and Parse packages versions in build.gradle (App File) as well as changing the dependencies versions in build.gralde (Project File)

项目文件:

AndroidManifest.xml(发生错误的文件部分)

AndroidManifest.xml(Portion of the file where the error occurs)

<service
        android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
        android:exported="true">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

build.gradle(项目)

     buildscript {
        repositories {
            google()
            jcenter()

        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.1'
            classpath 'com.google.gms:google-services:4.0.1'

        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
            maven { url "https://jitpack.io" }
        }
    }
    task clean(type: Delete) {
        delete rootProject.buildDir
}

build.gradle(模块)

build.gradle (Module)

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 29
        buildToolsVersion "29.0.1"
        defaultConfig {
            applicationId "com.sytech.uber"
            minSdkVersion 24
            targetSdkVersion 29
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.google.android.gms:play-services-maps:16.1.0'
        implementation 'com.google.firebase:firebase-analytics:17.2.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
        //Parse
        implementation "com.github.parse-community.Parse-SDK-Android:parse:1.20.0"
        implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.20.0"
        implementation 'com.parse.bolts:bolts-android:1.4.0'
        //Toasty  https://github.com/GrenderG/Toasty
        implementation 'com.github.GrenderG:Toasty:1.4.2'
        //Firebase
        implementation'com.google.firebase:firebase-auth:19.1.0'
        implementation 'com.google.firebase:firebase-messaging:17.6.0'
        implementation 'com.google.firebase:firebase-core:16.0.8'
    }

    apply plugin: 'com.google.gms.google-services'
    com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

推荐答案

FirebaseInstanceIdService 不再可用.使用最新版本的 parse 和 FirebaseMessagingService

FirebaseInstanceIdService is no longer usable. Use latest version of parse and FirebaseMessagingService

implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.21.0"

并使用 ParseFirebaseMessagingService

<service
    android:name="com.parse.fcm.ParseFirebaseMessagingService">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"/>
    </intent-filter>
</service>

这篇关于AndroidManifest 中未解析的类 ParseFirebaseInstanceIdService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 10:12