问题描述
上下文:通过Parse Server
作为后端和Firebase Cloud
消息服务
目标:从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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!