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

Unhandled Exception: MissingPlatformDirectoryException #523

Closed
1 task done
d2718nis opened this issue Jun 6, 2023 · 5 comments
Closed
1 task done

Unhandled Exception: MissingPlatformDirectoryException #523

d2718nis opened this issue Jun 6, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@d2718nis
Copy link

d2718nis commented Jun 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The application does not install xdg-user-dirs as a dependency if installed via Arch Linux AUR. Without this dependency it won't start and will throw an exception.
https://aur.archlinux.org/packages/spotube-bin

Expected Behavior

PKGBUILD should have xdg-user-dirs as a dependency.
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=spotube-bin

Steps to reproduce

  1. Don't have an xdg-user-dirs package installed in the system
  2. Install spotube from AUR
  3. Run the app

Operating System

Arch Linux

Spotube version

v2.7.1

Installation source

Arch User Repository (AUR)

Additional information

Exception trace:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPlatformDirectoryException(Unable to get application documents directory)
#0      getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:122)
<asynchronous suspension>
#1      HiveX.initFlutter (package:hive_flutter/src/hive_extensions.dart:12)
<asynchronous suspension>
#2      QueryClient.initialize (package:fl_query/src/core/client.dart:345)
<asynchronous suspension>
#3      main (package:spotube/main.dart:73)
<asynchronous suspension>
@d2718nis d2718nis added the bug Something isn't working label Jun 6, 2023
@d2718nis d2718nis changed the title Write the title here Unhandled Exception: MissingPlatformDirectoryException Jun 6, 2023
@d2718nis
Copy link
Author

d2718nis commented Jun 6, 2023

Followed this path to find this out. Maybe better solution would be using a different directory for that purpose, see #438

I figured this could be related to the flutter's path_provider plugin, but my investigation led me to this pull request
https://github.com/flutter/plugins/pull/2589/files#diff-134b40fdf68252321ba9541b7844f3d2407f51270631669598d4dfd3a7df595cR39

And then to this
https://pub.dev/packages/xdg_directories

getUserDirectory(String dirName) - Gets the value of the user dir with the given name. Requesting a user dir that doesn't exist returns null. The dirName argument is case-insensitive.

While I already had $HOME/Documents in my filesystem, it didn't work until I installed xdg-user-dirs. Some of the distros might have this package installed by desktop environments by default, but it seems not all of them.

@GiorgosXou
Copy link

Thanks, I confirm that pacman -S xdg-user-dirs made it work

@KRTirtho KRTirtho moved this to Backlog in Spotube Board Jul 3, 2023
@KRTirtho
Copy link
Owner

xdg-user-dirs is a required freedesktop specification. That means all distros by default includes it. Spotube tries to follow the spec as much as possible. So it is expected to be installed on user's linux OS
In the case of custom built distros like Arch or Gentoo we can't help much as it is completely on user's hand to install it or not. Thus it's impossible for us to guess which specs are met in the base system or not on these distros. That's why xdg-user-dirs was decided to be not included as a dependency

@Avinash-Bhat
Copy link

it's impossible for us to guess which specs are met in the base system or not on these distros.

Sorry if I'm blunt here, but this is such a lame excuse to not include it as a dependency.

Your app is not a part of any distro. So using this as an excuse doesn't make any sense. For all that is worth, your app is quite the opposite, it is not even tied to any platform nor with any type of device.

IF your app is using a command transitively, then you are supposed to add it as a dependency in PKGBUILD (and only used by ArchLinux).

For a regular user, these nuances are not important. They would be happy to use your app as long as it works. They simply don't care if it is written in their favorite language or is following a specification to the 't'.

Remember you are competing with the Spotify app, which despite being resource hungry does what it is supposed to do: Play Music.

That's all that matters, Play the damn Music! everything else is just noise.

@KRTirtho
Copy link
Owner

KRTirtho commented Sep 2, 2023

IF your app is using a command transitively, then you are supposed to add it as a dependency in PKGBUILD (and only used by ArchLinux).

In that sense, Spotube also needs gtk, glib, libwayland-egl/libx11, libwayland-client, libdbus etc. etc.
But does anyone specify them as AUR dependency? No, because it is expected to be installed as part of a standard desktop

Arch is not for regular users. The users are powerusers & they build their own flavored distro

Does Arch based distros like EndeavourOS, Artix etc has this issue? No, because these were build correctly implementing all standards for a regular user centric distro

Sorry if I'm blunt here, but this is such a lame excuse to not include it as a dependency.

Look, I'm the developer & I try to make sure my app is running on as many platform as possible. If it's not running because of my error, ok I'll fix it. But I'm not supposed to handle user errors. Sure I can assist them but I'm not responsible for these errors nor my project

@KRTirtho KRTirtho moved this from Backlog to Deployed in Spotube Board Oct 29, 2023
@github-project-automation github-project-automation bot moved this from Deployed to Done in Spotube Board Oct 29, 2023
@KRTirtho KRTirtho moved this from Done to Deployed in Spotube Board Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Deployed
Development

No branches or pull requests

4 participants