we are trying to connect
Firebase to Android Studio. The first two steps are marked with a green tick, but for some reason when we try to set the value of myRef, Android Studio says ‘Cannot resolve symbol
'setValue' is coloured red.
Screenshot of code:
FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("message"); myRef.setValue("Hello, World!");
myRef.setValue("Hello, World!"); is misplaced. It must be inside a method body. Move it inside the
Answered By – Bob Snyder