FirebaseUI-Android
FirebaseUI-Android copied to clipboard
Leak detected with LeakCanary
Step 1: Are you in the right place?
Yes
Step 2: Describe your environment
- Android device: Redmi Note 5
- Android OS version: 5.0
- Google Play Services version: 4.3.5
- Firebase/Play Services SDK version: 20.0.4
- FirebaseUI version: 7.1.1
Step 3: Describe the problem:
When closing the app this leak shows frequently even though there is no listener at all
Steps to reproduce:
- Add LeakCanary to app
- Implement Firebase Auth UI (PhoneAuth)
- Try to test it by logging in then open and close the app
Observed Results:
04-29 02:24:27.780 12111-12111/com.myapp.com D/LeakCanary:
┬───
│ GC Root: Global variable in native code
│
├─ com.google.firebase.auth.api.fallback.service.zza instance
│ Leaking: UNKNOWN
│ Retaining 506 B in 11 objects
│ zza instance of com.google.firebase.auth.api.fallback.service.FirebaseAuthFallbackService
│ ↓ zza.zza
│ ~~~
╰→ com.google.firebase.auth.api.fallback.service.FirebaseAuthFallbackService instance
Leaking: YES (ObjectWatcher was watching this because com.google.firebase.auth.api.fallback.service.
FirebaseAuthFallbackService received Service#onDestroy() callback and Service not held by ActivityThread)
Retaining 478 B in 10 objects
key = ac038340-ead9-4df3-856e-d554d8a60d6b
watchDurationMillis = 5224
retainedDurationMillis = 219
mApplication instance of com.myapp.com.App
mBase instance of android.app.ContextImpl
METADATA
Build.VERSION.SDK_INT: 21
Build.MANUFACTURER: Xiaomi
LeakCanary version: 2.7
App process name: com.myapp.com
Stats: LruCache[maxSize=3000,hits=122,misses=123181,hitRate=0%]
RandomAccess[bytes=11632648,reads=123181,travel=39030419727,range=42073912,size=55116410]
Heap dump reason: 1 retained objects, app is not visible
Analysis duration: 30287 ms
Expected Results:
No leak
Relevant Code:
private fun checkAuthStatus() {
if (FirebaseAuth.getInstance().currentUser == null)
startActivityForResult(authRequest(), authRequestCode)
else
startMain()
}
private fun authRequest(): Intent {
val builder = AuthUI.getInstance().createSignInIntentBuilder()
.setTheme(R.style.AuthStyle)
.setLogo(R.mipmap.ic_launcher)
.setIsSmartLockEnabled(true)
.setAvailableProviders(getProviderList())
builder.setTosAndPrivacyPolicyUrls(
"https://firebase.google.com/terms/",
"https://firebase.google.com/policies/analytics"
)
return builder.build()
}
private fun getProviderList() : List<IdpConfig>{
val providers: MutableList<IdpConfig> = ArrayList()
providers.add(PhoneBuilder().build())
return providers
}
Hi, thanks for filing this issue! We are unable to promise any timeline for this, but if others also have this issue, adding a +1 on this issue can help us prioritize adding this to the roadmap.
(Googler-only internal tracking bug: b/187073530)
+1
I am also having this issue
+1