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'. 'setValue' is coloured red.
Screenshot of code:

FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("message");
myRef.setValue("Hello, World!");
The statement myRef.setValue("Hello, World!"); is misplaced. It must be inside a method body. Move it inside the onCreate() or onStart() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With