I am trying to connect a brand new Samsung Galaxy S7 phone with Android 8.0 to my Kubuntu 14.04 computer via USB.
When I connect the device, it appears normally on the device notifier of my computer. I check SAMSUNG_Android -> Open with File Manager, like I did with my old Android 5.0 device (which was always unstable, but worked). At the same time, a notification on the device says Android system: Transferring media files via USB.
A dialog says No Storages found. Maybe you need to unlock your device? on the computer, while the device is not locked. At the same time, a dialog appears on the device, saying Allow access to phone data? The connected device will be able to access data on this phone. DENY/ALLOW. I check ALLOW but the file manager just shows an empty folder and refreshing does not help. No matter how many times I repeat, the behavior is always the same, and I never get to access any data.
Following advice on Android forums, I enable Developer options and USB debugging on the phone, while USB Configuration is MTP (Media Transfer Protocol) by default.
On the computer, I try installing and using mtpfs and jmtpfs, with no success. My understanding is that they both use libmtp underneath. I have libmtp 1.1.6 and mtp-detect says
Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP). Found 1 device(s): Samsung: Galaxy models (MTP) (04e8:6860) @ bus 5, dev 8
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
LIBMTP ERROR: couldnt parse extension
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
USB low-level info: bcdUSB: 512 bDeviceClass: 0 bDeviceSubClass: 0 bDeviceProtocol: 0 idVendor: 04e8 idProduct: 6860 IN endpoint maxpacket: 512 bytes OUT endpoint maxpacket: 512 bytes Raw device info: Bus location: 5 Device number: 8 Device entry info: Vendor: Samsung Vendor id: 0x04e8 Product: Galaxy models (MTP) Vendor id: 0x6860 Device flags: 0x48000207followed by a bunch of additional information.
I try connecting the phone to a Windows 7 computer, and it works perfectly.
I then try the same to a Windows 7 virtual machine inside my Kubuntu 14.04 host, but unfortunately no USB device is seen.
Then, I try a Kubuntu 18.04 virtual machine inside the same Kubuntu 14.04 host. This can see the USB device, but upon accessing with File Manager as above, a dialog on the computer says The process for the mtp protocol died unexpectedly while nothing appears on the device. Such message still appears randomly with my old Android 5.0 phone on my Kubuntu 14.04 computer, but eventually it works; while here the failure is consistent. mtp-detect now says
libmtp version: 1.1.13
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP). Found 1 device(s): Samsung: Galaxy models (MTP) (04e8:6860) @ bus 1, dev 4
Attempting to connect device(s)
LIBMTP PANIC: Could not open session! (Return code 8194) Try to reset the device.
Unable to open raw device 0
OK.Googling that message, I cannot find anything helpful.
Finally, I install the latest libmtp 1.1.15 from source on my Kubuntu 14.04. Nothing changes in the File Manager access, while mtp-detect similarly says
Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.15
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP). Found 1 device(s): Samsung: Galaxy models (MTP) (04e8:6860) @ bus 5, dev 16
Attempting to connect device(s)
LIBMTP PANIC: Could not open session! (Return code 8194) Try to reset the device.
Unable to open raw device 0
OK.and the device shows the familiar ALLOW/DENY dialog.
I remember trying another Samsung Android phone (6.0 or 7.0 I think) to another Kubuntu 14.04 computer with the same No Storages found and ALLOW/DENY behavior, but I didn't care much at the time because that was not my phone.
I have lost countless hours trying other workarounds with no success. I cannot change my operating system, at least not now. It's still supported for another six months, while the new system does not appear to work any better. I cannot change the phone either, but not being able to transfer files via USB makes it useless.
Such things should really work out of the box, right?
21 Answer
Check /etc/udev/rules.d for a file named xx-android.rules. I believe I manually created mine but it was years ago. Possibly on 14.04 as you're running. My android rules file is named 51-android.rules.
If this file exists, open it to determine if your specific device is included. I'm willing to bet it isn't.
If not,
`sudo <your_favorite_editor> /etc/udev/rules.d/xx-android.rules`and add the following rule
`ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"`If you don't have an xx-android.rules file, let me know and I'll tell you how to create one.
Just for GP, here's a template for an android rules files
SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
LABEL="android_usb_rules_begin"
ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
LABEL="android_usb_rules_end"The following requires root permissions... Place the template in /etc/udev/rules.d/. Save as xx-android.rules where 'xx' is a number between 10 and 99. IE; 51-android.rules
Log out of your session and log back in. I recommend rebooting instead.
7