Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase storage FirebaseApiNotAvailableException repeatedly in the log when offline

I'm using:

compile "com.google.firebase:firebase-core:9.0.1"
compile "com.google.firebase:firebase-storage:9.0.1"

And this is the code that I execute this with the device offline (no internet):

StorageReference mStorageRef = FirebaseStorage.getInstance().getReferenceFromUrl([MY_URL]);
mStorageRef.child("my_file.json").getBytes(Long.MAX_VALUE)
 .addOnSuccessListener(bla bla bla).addOnFailureListener(more bla bla)

I get this message repeated in my log every second:

W/ExponenentialBackoff: network unavailable, sleeping.
E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.firebase.FirebaseApiNotAvailableException: firebase-auth is not linked, please fall back to unauthenticated mode.

Is this a bug or expected behavior? I know that if I'm offline, I won't get the remote file, but why is firebase code trying to poll every second?

Note: when I get online again it executes the success/failure listener and finishes polling.

like image 860
Yair Kukielka Avatar asked May 31 '16 21:05

Yair Kukielka


2 Answers

Sorry for the log overload. The first (W/ExponenentialBackoff) needs to be pared down quite a bit (we're planning on better client side logging in the future), while the second (E/StorageUtil) can be prevented by linking Firebase Authentication in the app's build.gradle file:

implementation "com.google.firebase:firebase-auth:16.2.0".

like image 50
Mike McDonald Avatar answered Oct 13 '22 01:10

Mike McDonald


Google Play services updated to 9.0.2 The Google Play services version 9.0.2 release is now available. This release fixes a known issue with Firebase Authentication where the FirebaseAuthApi is not available on some devices. A FirebaseApiNotAvailableException error occurs when those devices attempt to use Authentication APIs.

like image 24
Dhaval Jivani Avatar answered Oct 13 '22 00:10

Dhaval Jivani