Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: FileNotFoundException throw when no cover is send to the media controls #94

Open
bexchauveto opened this issue Mar 23, 2023 · 0 comments

Comments

@bexchauveto
Copy link

Hi, I'm using the plugin in an Ionic 6/Capacitor application currently only for android and when using this plugin, I have this exception thrown when I don't set cover inside the MusicControlsOptions.

java.io.FileNotFoundException: : open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:492)
    at java.io.FileInputStream.<init>(FileInputStream.java:160)
    at com.homerours.musiccontrols.MusicControls.getBitmapFromLocal(MusicControls.java:289)
    at com.homerours.musiccontrols.MusicControls.getBitmapCover(MusicControls.java:276)
    at com.homerours.musiccontrols.MusicControls.-$$Nest$mgetBitmapCover(Unknown Source:0)
    at com.homerours.musiccontrols.MusicControls$2.run(MusicControls.java:186)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
    at libcore.io.IoBridge.open(IoBridge.java:478)
	... 8 more
java.io.FileNotFoundException: www/
    at android.content.res.AssetManager.nativeOpenAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:874)
    at android.content.res.AssetManager.open(AssetManager.java:851)
    at com.homerours.musiccontrols.MusicControls.getBitmapFromLocal(MusicControls.java:296)
    at com.homerours.musiccontrols.MusicControls.getBitmapCover(MusicControls.java:276)
    at com.homerours.musiccontrols.MusicControls.-$$Nest$mgetBitmapCover(Unknown Source:0)
    at com.homerours.musiccontrols.MusicControls$2.run(MusicControls.java:186)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)

The problem can easily be solved by checking is infos.cover is empty or not here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant