skip to Main Content

Firebase check item if exist

I'm saving an id to Firebase Realtime Database like this: binding.ivStar.setOnClickListener { firebaseDb.getReference("Users").child(uid).child("movie").push() .setValue(args.movie?.id)} And I need to check if this id exists in Firebase. And I did like this: private fun checkData() { val postRef = firebaseDb.getReference("Users").child(uid).child("movie") postRef.addListenerForSingleValueEvent(object :…

VIEW QUESTION

Android Studio – Caused by: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero)

When launching an activity my app crashes at getEncryptedSharedPrefs: if(getEncryptedSharedPrefs().getString("pinSettingsLogin", "")!!.isEmpty()){ getEncryptedSharedPrefs().edit() .putString("pinSettingsLogin" , "0000") .apply() } With this error: Caused by: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero). Weird thing is, this if statement works on Android 10…

VIEW QUESTION
Back To Top
Search