【问题标题】:Android Firebase AuthenticationAndroid Firebase 身份验证
【发布时间】:2017-08-23 04:18:10
【问题描述】:
 mAuth!!.createUserWithEmailAndPassword(email,password)
            .addOnCompleteListener(this){ task ->

                if (task.isSuccessful){
                    Toast.makeText(applicationContext,"Successful login",Toast.LENGTH_LONG).show()

                    var currentUser =mAuth!!.currentUser
                    //save in database
                    if(currentUser!=null) {
                        myRef.child("Users").child(SplitString(currentUser.email.toString())).child("Request").setValue(currentUser.uid)
                    }

                    LoadMain()

                }else
                {
                    Toast.makeText(applicationContext,"fail login",Toast.LENGTH_LONG).show()
                }

            }

我收到“包'com.example.package'的开发人员警告无法在频道'null'上发布通知,请参阅日志了解更多详细信息”

在日志中

    DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
GooglePlayServicesUtil: Google Play services out of date.  Requires 11020000 but found 10932470
Notification: Use of stream types is deprecated for operations other than volume control
Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case

我有

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'

}

在 build.gradle 中

我一直在看这个https://developer.android.com/guide/topics/ui/notifiers/notifications.html#ManageChannels,但我不知道如何处理这个

【问题讨论】:

  • 您发布的代码与通知无关。

标签: android firebase firebase-authentication kotlin


【解决方案1】:

您的播放服务版本过旧。 在 gradle 中使用最新的 google play 服务:

dependencies {
        compile 'com.google.android.gms:play-services:11.2.0'
    }

【讨论】:

  • 我尝试添加它,但我遇到了与 implementation 'com.android.support:appcompat-v7:26.0.1' 的兼容性问题
  • 可以显示它显示的兼容性问题的错误吗?我在我的项目中使用这两个库,它们工作正常。
  • 这不是播放服务版本的问题,它与使用较低版本的另一个库有关,请参阅这篇文章stackoverflow.com/a/42962984/4428159
【解决方案2】:

对于 Oreo Copatability,您必须使用频道并将它们分组以在 Oreo (android O) 上运行,否则您的通知将被丢弃。 使用此链接了解有关 Android O 中频道的更多信息link

中等link

了解 android O 的变化here

【讨论】:

    猜你喜欢
    • 2017-11-27
    • 2019-03-09
    • 2017-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-11
    • 1970-01-01
    相关资源
    最近更新 更多