android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知

android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知,第1张

概述我试图在Oreo版本中使用Firebase显示通知,因此当我获得解决方案时它不显示 NotificationCompat.Builder(这个,CHANNEL_ID),但它显示我像这个 我的build.gradle文件是 apply plugin: 'com.android.application' dependencies { compile project(':library 我试图在Oreo版本中使用Firebase显示通知,因此当我获得解决方案时它不显示
NotificationCompat.Builder(这个,CHANNEL_ID),但它显示我像这个

我的build.gradle文件是

apply plugin: 'com.androID.application'    dependencIEs {    compile project(':library')    compile project(':camerafragment')    compile 'com.Google.androID.gms:play-services:11.0.0'    compile 'com.squareup.picasso:picasso:2.5.2'    compile 'com.mcxiaoke.volley:library:1.0.17'    compile 'com.androID.support:appcompat-v7:26.0.0-Alpha1'    compile 'com.androID.support.constraint:constraint-layout:1.0.2'    compile 'com.androID.support:recyclervIEw-v7:26.0.0-Alpha1'    compile 'com.androID.support:cardvIEw-v7:26.0.0-Alpha1'    compile 'com.Google.firebase:firebase-messaging:11.0.0'    compile 'com.Google.androID.gms:play-services-maps:11.0.0'    compile 'com.facebook.androID:facebook-android-sdk:[4,5)'    compile 'com.androID.support:design:26.0.0-Alpha1'    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'    compile 'com.jakewharton:butterknife:7.0.1'    compile 'com.Google.androID.gms:play-services-auth:11.0.0'    compile 'net.gotev:uploadservice:2.1'    compile 'com.Google.firebase:firebase-auth:11.0.0'    compile 'com.Google.code.gson:gson:2.8.0'    compile 'com.androID.support:support-v4:26.0.0-Alpha1'    }    androID {    compileSdkVersion 27    buildToolsversion "27.0.0"    dexOptions {        javaMaxHeapSize "4g"    }    defaultConfig {        applicationID "com.trashmap"        minSdkVersion 17        targetSdkVersion 27        // Enabling multIDex support.        multIDexEnabled true        versionCode 17        versionname "1.16"        testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"    }    buildTypes {        release {            MinifyEnabled false           // shrinkResources true//new add to reduce size            proguardfiles getDefaultProguardfile('proguard-androID.txt'),'proguard-rules.pro'        }    }      sourceSets {        main {            manifest.srcfile 'AndroIDManifest.xml'            java.srcDirs = ['src']            res.srcDirs = ['res']        }    }}apply plugin: 'com.Google.gms.Google-services'
解决方法
NotificationCompat.Builder (Context context)

This constructor was deprecated in API level 26.1.0.

use NotificationCompat.Builder(Context,String) instead. All posted Notifications must specify a NotificationChannel ID.

你已经定义了编译’com.androID.support:support-v4:26.0.0-Alpha1’所以你必须改变你的支持库的版本号.

总结

以上是内存溢出为你收集整理的android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知全部内容,希望文章能够帮你解决android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1138901.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存