4

Good day all

Following the method specified in the GDM3 wiki to add a desktop file for the GNOME menu,

I get the following error:

Oct  4 09:54:06 cx-W55xEU gnome-software[1741]: failed to rescan: Failed to parse /home/cx/.local/share/applications/android-studio.desktop file: cannot process file of type application/x-desktop
Oct  4 09:54:47 cx-W55xEU gnome-software[1741]: failed to rescan: Failed to parse /usr/share/applications/android-studio.desktop file: cannot process file of type application/x-desktop

The desktop file I am trying to create is for Android Studio.

Desktop file contents

[Desktop Entry]

# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=Android-Studio

# A comment which can/will be used as a tooltip
Comment=Android studio IDE

# The path to the folder in which the executable is run
Path=/opt/google/android-studio/android-studio/bin/

# The executable of the application.
Exec=studio.sh

# The name of the icon that will be used to display this entry
Icon=studio.png

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Education;Languages;Java;

Path link specified contains:

# ll /opt/google/android-studio/android-studio/bin/

total 152
drwxrwxr-x 1 root root   348 Sep 15 16:17 ./
drwxrwxr-x 1 root root   160 Sep 15 16:17 ../
-rw-r--r-- 1 root root   136 Sep 15 15:49 appletviewer.policy
-rwxr-xr-x 1 root root 23072 Sep 15 15:49 fsnotifier*
-rwxr-xr-x 1 root root 29648 Sep 15 15:49 fsnotifier64*
-rwxr-xr-x 1 root root 26453 Sep 15 15:49 fsnotifier-arm*
-rw-r--r-- 1 root root  7482 Sep 15 15:52 idea.properties
-rwxr-xr-x 1 root root   278 Sep 15 15:49 inspect.sh*
-rw-r--r-- 1 root root  8531 Sep 15 15:49 libbreakgen64.so
-rw-r--r-- 1 root root  6807 Sep 15 15:49 libbreakgen.so
drwxrwxr-x 1 root root    12 Sep 15 16:17 lldb/
-rw-r--r-- 1 root root  2275 Sep 15 15:49 log.xml
-rw-r--r-- 1 root root   527 Sep 15 15:49 studio64.vmoptions
-rw-r--r-- 1 root root  9816 Sep 15 15:49 studio.png
-rwxr-xr-x 1 root root  6876 Sep 15 15:49 studio.sh*
-rw-r--r-- 1 root root   534 Sep 15 15:49 studio.vmoptions

This is a curious error as to I have never had a problem like this when adding a .desktop file

Any thoughts?

1 Answer 1

3

I founnd my answer after a 'wee-bit' more Googling, surprisingly something that is not mentioned on the GDM wiki but something I came across per-chance from a askubuntu post

Solution:

Add bash -i infront of the Exec file, as shown

Exec=bash -i "/opt/google/android-studio/android-studio/bin/studio.sh" %f

Final Solution

[Desktop Entry]

# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=Android-Studio

# A comment which can/will be used as a tooltip
Comment=Android studio IDE

# The executable of the application.
Exec=bash -i "/opt/google/android-studio/android-studio/bin/studio.sh" %f

# The name of the icon that will be used to display this entry
Icon=/opt/google/android-studio/android-studio/bin/studio.png

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Education;Languages;Java;

StartupNotify=true

Note aswel, I added a line StartupNotify. I found a reasonable explaination for its purpose, aswel as a few other components of a .desktop file

Hope this helps!

1
  • 1
    I'm glad it works, but this does not explain the cannot process file of type application/x-desktop error message :-\
    – ckujau
    Apr 30, 2019 at 23:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .