I connected my Lumia 640 mobile to Ubuntu and when I tried to open it shows this error:

I connected my Lumia 640 mobile to Ubuntu and when I tried to open it shows this error:

Install gMTP (simple file transfer program for MTP based devices). In the terminal (to open a terminal window, press Ctrl + Alt + T; to close it, press Ctrl + D), type:
sudo apt install gmtp
It's not perfect, but better than nothing.
Tip: When you're successfully connected, enable "Folder view" in the menu.
The Solution is the same as the one above from @namelesseke but with Ubunut 18.10 and nautilus 3.26.4 the error message is different, i.e. the error says something like
Unhandled error message: The name 1.994 was not provided by any service files
After installing gmtp with
$ sudo apt-get install gmtp
everything worked like charm.
Another reason could be that the phone is blocked by USBGuard:
usbguard list-devices --blocked
usbguard allow-device -p id_of_device_to_allow