AssetManager.java
- Android Studio version: 2021.1.1 Patch 2
- Firebase Component: _____ (Database, Firestore, Storage, Functions, etc)
- Component version: _firebase-bom: 29.0.3
- implementation 'com.google.firebase:firebase-analytics'
- implementation 'com.google.firebase:firebase-auth'
- implementation 'com.google.firebase:firebase-auth-ktx'
- implementation 'com.google.firebase:firebase-messaging'
- implementation 'com.google.firebase:firebase-dynamic-links'
- implementation 'com.google.firebase:firebase-perf'
- implementation 'com.google.firebase:firebase-crashlytics-ndk'
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur? This could be a description, log/console output, etc.
Relevant Code:
Fatal Exception: java.util.concurrent.TimeoutException: android.content.res.AssetManager$AssetInputStream.finalize() timed out after 10 seconds
at android.content.res.AssetManager$AssetInputStream.close(AssetManager.java:622)
at android.content.res.AssetManager$AssetInputStream.finalize(AssetManager.java:655)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:217)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:200)
at java.lang.Thread.run(Thread.java:818)


I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
Hi @3HJack, thanks for reporting with code snippets. Just want to clarify, is the issue you're experiencing on Firebase Crashlytics? Any chance you could provide details how to reproduce this issue? Or if you have any MCVE, it'll greatly help us in our investigation.
Yes,It's experiencing on Firebase Crashlytics.I can't reproduce it.But I fix it by downgrade firebase to 29.0.1.
Hi @3HJack, thanks for the extra details. Due to the nature of the issue being device specific, it is difficult to reproduce and investigate since we don't have the said device brand. Let's keep this issue open in case our engineers might have an idea how to fix this.
@argzdev I found this method to check if flutter exists. So can you provide a switcher to ignore this checking if this bug is hard to reproduce and fix? Because we don't use flutter, so it should always return false for assetPathExists(FLUTTER_ASSETS_PATH)
@argzdev I found this method to check if flutter exists. So can you provide a switcher to ignore this checking if this bug is hard to reproduce and fix? Because we don't use flutter, so it should always return
falseforassetPathExists(FLUTTER_ASSETS_PATH)
@argzdev I think this suggestion can solve the problem.
Hi @chenggoi & @3HJack, thanks for the suggestions. Upon investigation, it looks like the assetPathExists is the switch to check if the development platform is Flutter or not.
A quick fix for this is to add a catch(TimeoutException e), I'll consult with an engineer to see if this solution is feasible.
@argzdev The crash is not happening in the assetPathExists function, so I don't think it can be fixed.
Hi @3HJack, we were able to come up with a fix using .open() instead. Since .list() have performance issues, I think .open() would be a better option to choose when checking if a specific file exists, at the same time if any issue occurs, the correct exception (IOException) will definitely get caught. That being said, the fix for this has been merged, so I'll be closing this now.