MTP not working after Ubuntu 18.04 upgrade

I could connect to my Android Alcatel Pixi 4 (5) via MTP on Ubuntu 16.04 (there was a bug where the protocol "died unexpectedly" if a file delete was followed by a file copy, but other than that, it worked).

After upgrading to Ubuntu 18.04 I get "protocol died unexpectedly" in Dolphin whenever I try to browse the device.

#> mtp-detect
libmtp version: 1.1.13

Listing raw device(s)
Device 0 (VID=1bbb and PID=0167) is a Alcatel/TCT 6010D/TCL S950.
   Found 1 device(s):
   Alcatel/TCT: 6010D/TCL S950 (1bbb:0167) @ bus 3, dev 2
Attempting to connect device(s)
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
ignoring libusb_claim_interface() = -6LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

dmesg contains:

[  471.588800] usb 3-4: usbfs: process 9290 (gmtp) did not claim interface 0 before use
[  471.715547] usb 3-4: reset high-speed USB device number 3 using xhci_hcd
[  471.864513] usb 3-4: usbfs: process 9290 (gmtp) did not claim interface 0 before use
[  471.864735] usb 3-4: usbfs: process 2562 (events) did not claim interface 0 before use

I tried building libmtp-1.1.15 from source, problem persists. The device works via MTP access on Windows on the same machine.


Solution 1:

I had similar issue with my openSUSE. After I have installed jmtpfs, kio-mtp mtp-tools the issue disappeared and everything started to work correctly.

If you have already used jmtpfs or a similar tool with a mount point of ~/android_mount/, then first make sure it's not mounted:

# unmount previously mounted device
fusermount -u ~/android_mount/

# this should show empty directory
ls -la ~/android_mount/

You can also use the output of df to see if perhaps it's mounted elsewhere.

Otherwise, create a new mount point, let's say ~/android_mount/ and mount your Android phone, after you connected it with USB cable and switched it to 'File Transfer' mode (it normally defaults to 'Charge'):

# make directory to mount
mkdir -p ~/android_mount/

# mount the device (can take several minutes)
# it will also show device information while mounting
jmtpfs ~/android_mount/

# now you should see internal storage if you don't have an SD card
ls -la ~/android_mount/
drwxrwxr-x 12 login login    0 Jan  3  44248648 Internal storage
# if it has an SD card too, then it'll show 2 entries

# look inside
ls -la ~/android_mount/Internal\ storage/

Now you can operate on the files as you'd on any USB attached device.

# when finished, unmount the device
fusermount -u ~/android_mount/

Could you add jmtpfs -l to your question?