Assignments are not expressions, and only expressions are allowed in this context I don't know how to fix this problem
private fun uploadImageToFirebaswStorage(){
if (selectedphotoUri = null) return
val filename = UUID.randomUUID().toString()
val ref = FirebaseStorage.getInstance().getReference("/images/$filename")
ref.putFile(selectedphotoUri!!)
.addOnSuccessListener {
Log.d("Register","Successfully uploaded image: ${it.metadata?.path}")}
selectedphotoUri = nullis an assignment. Most likely, you wantselectedphotoUri == null(two equals signs), which is the equality expression.