I just started using Firebase for Android and I have hardly and code in the application but I am getting this warning in the console:
D/FirebaseInstanceId: background sync failed: MISSING_INSTANCEID_SERVICE, retry in 80s
I have done very little reading from the database in the application and have not gotten any data back, so I figure this might be why. I believe I set the application up correctly so how should I go about fixing this warning?
Thank you very much for all help and support!
And in case you were wondering, this is my code:
FirebaseDatabase firebase;
DatabaseReference userRef;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
firebase = FirebaseDatabase.getInstance();
userRef = firebase.getReference("Users");
System.out.println("\n\n\n"+userRef+"\n\n\n");
userRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// This method is called once with the initial value and again
// whenever data at this location is updated.
String value = dataSnapshot.getValue(String.class);
//Log.d(TAG, "Value is: " + value);
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
// Log.w(TAG, "Failed to read value.", error.toException());
}
});
}
Dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
}