Robby Firmansyah Robby Firmansyah - 5 months ago 31
Android Question

Having trouble with Firebase Auth Android

I have launch my app and when I clicked Share button then my apps stopped working, error show like this :

Caused by: java.net.URISyntaxException: Invalid scheme specified: https:/findingyou2.firebaseio.com/
at com.firebase.client.utilities.Utilities.parseUrl(Utilities.java:23)
at com.firebase.client.Firebase.<init>(Firebase.java:155) 
at com.robby.findingyou.LocationShareReceiver.SetAlarm(LocationShareReceiver.java:116) 
at com.robby.findingyou.LocationServices.onStartCommand(LocationServices.java:27) 


this is LocationShareReceiver has contain error with Firebase :

app = Application.instance();
Log.v("application", app.toString());
if(app != null) {
app.setSharingStatus(true, context);
}
Firebase.setAndroidContext(context);
mFirebaseRef = new Firebase("https:/findingyou2.firebaseio.com/");
if(mFirebaseRef != null) {
authData = mFirebaseRef.getAuth();
if(authData != null)
mUserID = authData.getUid();
}
if(mFirebaseRef != null && authData != null) {
mFirebaseRef.child("users").child(mUserID).child("expiration").setValue(expiration);
}


And this error too from LocationServices.java :

@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
int interval = Integer.parseInt(intent.getStringExtra("frequency"));
int d = Integer.parseInt(intent.getStringExtra("duration"));
long expiration = System.currentTimeMillis() + 1000*60*d;
Log.v("duration", d + "");
alarm.SetAlarm(LocationServices.this, interval, expiration);
return START_NOT_STICKY;
}


that's error because of what? Please help me with this

Answer

URISyntaxException, because your url is in wrong format

Just replace

https:/findingyou2.firebaseio.com/

to

https://findingyou2.firebaseio.com/