Issues related to the code in this repository.
PhoneAuthActivity is leaking. I believe, it might be OnVerificationStateChangedCallbacks, which we are sending on call to verifyPhoneNumber.
Leak track 1:
com.google.firebase.quickstart.auth.PhoneAuthActivity@317662720 (0x12ef2600)
--- (leak) zwbWR in com.google.android.gms.internal.jw@314986400 (0x12c64fa0)
------- (leak) zzbXd com.google.android.gms.internal.kl@314953312 (0x12c5ce60)
----------- (leak) zwbWR in com.google.android.gms.internal.jw@314986400 (0x12c64fa0)
------- com.google.android.gms.internal.jb@314960960 (0x12c5ec40)
--- android.support.v7.widget.AppCompatTextView@317902848 (0x12f
--- com.google.android.gms.internal.jb@314960960 (0x12c5ec40)
--- android.support.v7.widget.AppCompatTextView@317902848 (0x12f2d000)
--- android.app.ContextImpl@317160464 (0x12e77c10)
--- android.support.v7.widget.AppCompatEditText@317910016 (0x12f2ec00)
--- com.android.internal.policy.PhoneLayoutInflater@317202288 (0x12e81f70)
Leak track 2:
com.google.android.gms.internal.zzdjv@721758912 (0x2b052ac0)
--- (leak) zzlie in com.google.android.gms.internal.zzdkk@722195072 (0x2b0bd280)
------ zzlhl in com.google.android.gms.internal.zzdjv@721758912 (0x2b052ac0)
------ java.lang.ref.FinalizerReference@722192712 (0x2b0bc948)
--- zzhlc in com.google.android.gms.internal.zzdja@722095152 (0x2b0a4c30)
------ zzlhq in com.google.android.gms.internal.zzdjv@721758912 (0x2b052ac0)
------ (leak) zzlie in com.google.android.gms.internal.zzdkk@722195072 (0x2b0bd280)
------ com.google.android.gms.internal.zzdja@722095152 (0x2b0a4c30)
```
It is happening with the provided sample PhoneAuthActivity.
I think, It is leaking at below class
`package com.google.android.gms.internal;
import android.os.RemoteException;
import com.google.android.gms.common.internal.zzbp;
import com.google.android.gms.internal.zzdki;
import com.google.android.gms.internal.zzdle;
import com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks;
final class zzdjv extends zzdki
private final zzdle zzlhf;
public zzdjv(zzdle var1) {
super(8);
this.zzlhf = (zzdle)zzbp.zzu(var1);
}
public final void dispatch() throws RemoteException {
this.zzlhn.zza(this.zzlhf, this.zzlhl);
}
public final void zzbof() {
}
}
`
```
@jyothiasapu thanks for reporting this memory leak! I will investigate and let you know if I find anything interesting.
is the memory leak solved?
@samtstern It is leaking activity instances. I am using version 16.1.0. Can you please provide the solution?
I am getting the same issue what @kagile mentioned with 16.1.0. Any new updates on this issue?
Hey all. Apologies for not getting back to this sooner but I have brought this to the attention of the team that makes the Firebase Auth SDK. We'll see what we can find!
In the documentation, there is another method using TaskExecutor.MAIN_THREAD instead of an Activity. I've tried this and no more leak detected.
Passing an executor instead of the activity worked for me:
import com.google.android.gms.common.util.concurrent.HandlerExecutor
phoneAuth.verifyPhoneNumber(phone, 60, TimeUnit.SECONDS, HandlerExecutor(mainLooper), onVerificationStateChangedCallbacks)
Is this issue solved?
I think we need a proper method to detach the onVerificationStateChangedCallbacks, because it causes memory leak in case the Activity is destroyed before verification process is completed!! Any suggestions?
still nothing?
Most helpful comment
is the memory leak solved?