firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

AssetManager.java

Open 3HJack opened this issue 4 years ago • 9 comments

  • 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)

image

image

3HJack avatar Mar 31 '22 08:03 3HJack

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.

google-oss-bot avatar Mar 31 '22 08:03 google-oss-bot

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.

argzdev avatar Mar 31 '22 10:03 argzdev

Yes,It's experiencing on Firebase Crashlytics.I can't reproduce it.But I fix it by downgrade firebase to 29.0.1.

3HJack avatar Mar 31 '22 10:03 3HJack

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 avatar Apr 01 '22 16:04 argzdev

@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)

chenggoi avatar Apr 02 '22 05:04 chenggoi

@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 think this suggestion can solve the problem.

3HJack avatar Apr 08 '22 03:04 3HJack

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 avatar Apr 08 '22 09:04 argzdev

@argzdev The crash is not happening in the assetPathExists function, so I don't think it can be fixed.

3HJack avatar Apr 08 '22 09:04 3HJack

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.

argzdev avatar Apr 08 '22 18:04 argzdev