gpt4 book ai didi

android - Firebase 云消息传递的 AbstractMethodError

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:48:19 28 4
gpt4 key购买 nike

我刚刚将应用程序的 GCM 更改为 FCM,并向其中添加了 OneSignal。完全遵循指南,甚至创建了一个新的监听器服务来处理推送通知。

然而,即使没有监听器,每当我收到推送时,应用程序都会崩溃并显示以下消息:

09-27 14:11:21.483 25361-25361/com.appname.here E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.appname.here, PID: 25361
java.lang.AbstractMethodError: abstract method "android.content.Intent com.google.firebase.iid.zzb.zzae(android.content.Intent)"
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3028)
at android.app.ActivityThread.access$2200(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1454)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

我已经从监听器中删除了所有代码,即便如此,还是会发生这种情况。

我是不是以错误的方式实现了某些东西,还是我遗漏了什么?

构建.gradle:

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.22.0'
}
}
apply plugin: 'com.android.application'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'io.fabric'
apply plugin: 'android-apt'

android {
lintOptions {
checkReleaseBuilds false
}
dexOptions {
javaMaxHeapSize "2g"
}
signingConfigs {
release {

}
debug {

}
}
compileSdkVersion 24
buildToolsVersion '24.0.1'

defaultConfig {
applicationId "com.appname.here"
minSdkVersion 16
targetSdkVersion 24
versionCode getDate()
versionName '2.1.0'
multiDexEnabled true

manifestPlaceholders = [manifestApplicationId: "${applicationId}",
onesignal_app_id: "*******",
onesignal_google_project_number: "********"]
}

applicationVariants.all { variant ->
def apkName = "appnamehere";
apkName += "_" + variant.buildType.name + "_" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode;
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent, apkName + ".apk");
}
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
debuggable true
jniDebuggable true
signingConfig signingConfigs.release
renderscriptDebuggable true

}
}
productFlavors {
Live {
signingConfig signingConfigs.release
}
Develop {
signingConfig signingConfigs.release
applicationIdSuffix ".develop"
}
}
}

def getDate() {
def date = new Date()
def formattedDate = date.format('yyMMddHHmm')
return formattedDate.toInteger()
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile project(':libphonenumber-5.9')
compile project(':jaalee-sdk')
compile project(':socialauth-android-3.2')
compile('com.crashlytics.sdk.android:crashlytics:2.6.4@aar') {
transitive = true;
}

compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.onesignal:OneSignal:3.3.0@aar'

compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:customtabs:24.2.1'
// compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha5'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.android.gms:play-services-identity:9.6.1'
compile 'com.google.android.gms:play-services-location:9.6.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.googlecode.libphonenumber:libphonenumber:7.5.2'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.jakewharton:butterknife:8.2.1'
compile 'com.thebluealliance:spectrum:0.5.0'
compile 'com.joanzapata.iconify:android-iconify-entypo:2.2.2'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
compile 'com.joanzapata.iconify:android-iconify-material:2.2.2'
compile 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jonathanfinerty.once:once:1.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'

compile 'com.google.firebase:firebase-core:9.2.0'
compile "com.google.firebase:firebase-messaging:9.0.2"

compile 'com.github.clans:fab:1.6.4' // Expandable floating button.
compile 'com.androidadvance:topsnackbar:1.1.1' // Top snackbar.
compile 'com.baoyz.swipemenulistview:library:1.3.0' // Swipeable listview.
compile 'me.relex:circleindicator:1.2.1@aar' // Pager indicator.
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
}

apply plugin: 'com.google.gms.google-services'

crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}

最佳答案

更新 Firebase 库的版本号以与其他 Google Play 服务库保持一致:

改变:

compile 'com.google.firebase:firebase-core:9.2.0'
compile "com.google.firebase:firebase-messaging:9.0.2"

收件人:

compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-messaging:9.6.1'

关于android - Firebase 云消息传递的 AbstractMethodError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39724731/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com