Неразрешенный класс ParseFirebaseInstanceIdService в AndroidManifest - PullRequest
2 голосов
/ 17 октября 2019

Контекст: Реализация облачных push-уведомлений на Android через Parse Server

в качестве бэкэнда и Firebase Cloud Служба сообщений

Цель: Отправкаpush-уведомление от Parse к соответствующему приложению Android

Проблема: При добавлении класса com.parse.fcm.ParseFirebaseInstanceIdService в файл AndroidManifest.xml оно остается неразрешенным.

Уже опробованные решения: Изменение версий пакетов Firebase и Parse в build.gradle (файл приложения), а также изменение версий зависимостей в build.gralde (файл проекта)

Файлы проекта:

AndroidManifest.xml (Часть файла, в которой возникает ошибка)

<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 (Project)

     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 (Модуль)

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

1 Ответ

2 голосов
/ 17 октября 2019

FirebaseInstanceIdService больше не используется. Используйте последнюю версию parse и 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>
...