Fixed
Status Update
Comments
am...@google.com <am...@google.com>
fr...@gmail.com <fr...@gmail.com> #5
Well, after 3 years, I would think it should get more than a "Small" priority. Really guys, this is a usability killer for many apps. I don't understands how this is not seen as an issue....
am...@google.com <am...@google.com> #6
Hi,
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
to...@gmail.com <to...@gmail.com> #7
[Comment deleted]
am...@google.com <am...@google.com> #8
[Comment deleted]
na...@gmail.com <na...@gmail.com> #9
Have any of you tried doing a media scan?
ar...@gmail.com <ar...@gmail.com> #10
re: "Have any of you tried doing a media scan?"
Yes, I just tried. I've been trying to do a media scan on Nexus 7 Android 4.4.2 and reading via USB on a Mac. I am creating a new directory on external storage and putting files in that directory. Running the scan on those files does nothing. Also running the scan on my new directory causes my Mac to present the directory as a 4k file (and not as a directory). I have also played with called context.sendBroadcast() afterward, with no benefit.
Yes, I just tried. I've been trying to do a media scan on Nexus 7 Android 4.4.2 and reading via USB on a Mac. I am creating a new directory on external storage and putting files in that directory. Running the scan on those files does nothing. Also running the scan on my new directory causes my Mac to present the directory as a 4k file (and not as a directory). I have also played with called context.sendBroadcast() afterward, with no benefit.
ar...@gmail.com <ar...@gmail.com> #11
I just played around with doing media scans and broadcasting files created in the standard Downloads directory, and they never showed up when connecting to the Mac.
ar...@gmail.com <ar...@gmail.com> #12
When I put my files in the standard Download directory and run the app SD Scanner, they do show up via USB. It's just not possible to use a custom directory. Also, I wonder why my programmatic attempt to do exactly this did not work.
ar...@gmail.com <ar...@gmail.com> #13
Okay, I have it working for files, but custom directories (at least those created in the external storage root) only show up as 4k files on my Mac. My problem with files was that apparently MediaScannerConnection.scanFile() and context.sendBroadcast() can't be called from onDestroy(). I'm now calling from onPause(), but I don't know if that will always suffice.
fr...@gmail.com <fr...@gmail.com> #14
Media (when it works) is only still just a hack, not a fix....
ar...@gmail.com <ar...@gmail.com> #15
More importantly, I spent about 6 hours trying to work around a significant bug that has been reported to Google on a nearly monthly basis since 2012, and I only found a partial solution. I look forward to a fix.
ca...@gmail.com <ca...@gmail.com> #16
Still occurring with Android 6.0.1 on Nexus 5.
mo...@runsafe.no <mo...@runsafe.no> #17
For anyone wanting a quick fix, get media.Re.Scan from the play store.
mt...@gmail.com <mt...@gmail.com> #18
Android 5.x
Windows 10 x64
MTP: create folder over Explorer (file browser or total commander) on Windows, MTP a lot of time stop responding or create a folder named as "New folder" and can't rename.
- Or after rename folder is named as "New folder" but is unaccesible. In phone looks that is renamed, but not on Widnows.
- files are not updated
- new files are not visible, but when I try to copy on SD card repeatly, it shown that file exist...
- complete MTP is totally unusable and traditional Mass storage is not available :(
Windows 10 x64
MTP: create folder over Explorer (file browser or total commander) on Windows, MTP a lot of time stop responding or create a folder named as "New folder" and can't rename.
- Or after rename folder is named as "New folder" but is unaccesible. In phone looks that is renamed, but not on Widnows.
- files are not updated
- new files are not visible, but when I try to copy on SD card repeatly, it shown that file exist...
- complete MTP is totally unusable and traditional Mass storage is not available :(
tr...@gmail.com <tr...@gmail.com> #19
It occurs on nexus 6 also, I have to reboot it few times a day to get files transferred. (Perhaps media rescan app could also help but it is a bug never the less. I see this was an existing bug for years long now. I hope somebody would take it serious.
ak...@gmail.com <ak...@gmail.com> #20
It occurs on every single phone I've tried. Latest on a Sony Xperia Z2. The problem isn't lack of information or such, it's just googles absolute lack of interest to fix this issue. It's laughable that they can allow this issue to exists for year upon year, it's worse than my own procrastination of school essays.
ca...@gmail.com <ca...@gmail.com> #21
I've found that if I create a folder on the phone via windows it shows up in the file directory on the phone. I can then move the files on the phone(using the phone)that are not visible in Windows into the folder, and hey presto - the are suddenly visible in Windows.
pi...@gmail.com <pi...@gmail.com> #22
That such a simple problem hasn't been resolved for over three years is already ridiculous, all the more so now that the original issue has been marked as "obsolete" and closed. Might 2016 be the year this finally gets fixed? I'm not holding my breath...
Meanwhile, I would like to share the two most convenient ways I know of to work around this problem. Hopefully this posted here saves someone some time searching:
Method #1:
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
Method #2:
Settings → Developer options → Development tools → Media Provider → Scan SD Card
To enable Developer options tap 7x on Build number in Settings → About phone.
On Windows, you may need to press F5 in Windows Explorer to refresh the view afterwards.
Meanwhile, I would like to share the two most convenient ways I know of to work around this problem. Hopefully this posted here saves someone some time searching:
Method #1:
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
Method #2:
Settings → Developer options → Development tools → Media Provider → Scan SD Card
To enable Developer options tap 7x on Build number in Settings → About phone.
On Windows, you may need to press F5 in Windows Explorer to refresh the view afterwards.
si...@gmail.com <si...@gmail.com> #23
Still occurring with Android 6.0.1 on Nexus 5.
fr...@gmail.com <fr...@gmail.com> #24
Sarkie mtpfix Does not works?
a....@googlemail.com <a....@googlemail.com> #25
Hey idiots... wake up and fix this shit!
fr...@gmail.com <fr...@gmail.com> #26
@ francesc... regardless of hacks & workarounds we can come up with, none are ideal. I don't want to have have to include extra steps in procedures for users if I'm writing Standards Operating Procedures, or need to have them run a service in the background to fix a BASIC FLAW in the way MTP has been designed by Google.
This is pretty much as if in Windows, you wouldn't be able to transfer new files created by OFfice to USB until you restarted your computer. This would be considered retarded, rightly.
Same for this MTP crap..... Basic design flaws are Google's to solve, not the developers.
This is pretty much as if in Windows, you wouldn't be able to transfer new files created by OFfice to USB until you restarted your computer. This would be considered retarded, rightly.
Same for this MTP crap..... Basic design flaws are Google's to solve, not the developers.
iy...@gmail.com <iy...@gmail.com> #27
Makes you wonder what "assigned" and "high priority" mean, doesn't it? And whether "obsolete" actually means "we're bored of this valid bug". Of course, the real question is: why can't MTP read the phone like a simple file server and relies on the media database instead?
wh...@gmail.com <wh...@gmail.com> #28
or, why media database isn't updated correctly regardless of what api has been used to create a file?
do...@gmail.com <do...@gmail.com> #29
It's seems ridiculous that this hasn't been addressed. A huge inconvenience when trying to transfer files. I would think this is an easy fix.
an...@gmail.com <an...@gmail.com> #30
This issue is still prsent on a Nexus6P running Android 6.0.1. Newly-created folders and newly-created files do not automatically appear in Windows File Explorer. New folders and new files *do* appear with the following workaround helpfully suggested by so many people (tested against API23):
MediaScannerConnection.scanFile(
this,
new String[]{ file.getAbsolutePath() }, // "file" was created with "new File(...)"
null,
null);
Appending text to an existing file does NOT get updated by this workaround, for example, an application that continuously updates a log file. Something like:
FileWriter fileWriter = new FileWriter(file, true); // "true" = append
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
bufferedWriter.write(message); // "message" is a String
bufferedWriter.newLine();
bufferedWriter.flush();
bufferedWriter.close(); // probably makes previous "flush" superfluous
MediaScannerConnection.scanFile(...); // appended file is NOT updated in Windows Explorer
Rebooting the Nexus6P always seems to refresh the files to show the full content in Windows Explorer.
MediaScannerConnection.scanFile(
this,
new String[]{ file.getAbsolutePath() }, // "file" was created with "new File(...)"
null,
null);
Appending text to an existing file does NOT get updated by this workaround, for example, an application that continuously updates a log file. Something like:
FileWriter fileWriter = new FileWriter(file, true); // "true" = append
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
bufferedWriter.write(message); // "message" is a String
bufferedWriter.newLine();
bufferedWriter.flush();
bufferedWriter.close(); // probably makes previous "flush" superfluous
MediaScannerConnection.scanFile(...); // appended file is NOT updated in Windows Explorer
Rebooting the Nexus6P always seems to refresh the files to show the full content in Windows Explorer.
ro...@gmail.com <ro...@gmail.com> #31
This appears to have become much worse in a recent update. I could sync files using MTP before, but now whenever I open either internal storage or the SD card in Windows Explorer, a few folders with a few files missing, or lots of files are reported as having 0 size.
Also restarting doesn't fix this issue, it just results in different files going missing or becoming "empty".
Also restarting doesn't fix this issue, it just results in different files going missing or becoming "empty".
pi...@gmail.com <pi...@gmail.com> #32
Running Android 6.0.1 and confirming this is occurring for me.
Reputation of Google just dropped considering how long this issue has been getting actively ignored (since 2012).
Reputation of Google just dropped considering how long this issue has been getting actively ignored (since 2012).
si...@gmail.com <si...@gmail.com> #33
The lack of news from developer/support team on this problem it's ridiculous...
am...@google.com <am...@google.com> #34
Development team is working on this, once we have any update, we will update this tracker
si...@gmail.com <si...@gmail.com> #35
9 months ago you said the same thing, we have to trust you this time?
sh...@gmail.com <sh...@gmail.com> #36
How much more time is it gonna take to resolve it?
Even the restart action requires a root permission from system.
Even the restart action requires a root permission from system.
ma...@googlemail.com <ma...@googlemail.com> #37
Still no fix here..
Even the scanFile Workaround just shows empty Files instead of folders..
C'mon Google.. can't be so hard to fix this
Even the scanFile Workaround just shows empty Files instead of folders..
C'mon Google.. can't be so hard to fix this
ma...@googlemail.com <ma...@googlemail.com> #38
Okay fixed my app to show directories and images I create with my app..
But still no fix to update my log-file that's written.
Can you please give an update on this?
But still no fix to update my log-file that's written.
Can you please give an update on this?
sh...@gmail.com <sh...@gmail.com> #39
@38 maik...@googlemail.com
How did you fix your app to show directories and images.
Is there any way to detect a Android Device in PC without the drivers and just through ADB interface protocol?
How did you fix your app to show directories and images.
Is there any way to detect a Android Device in PC without the drivers and just through ADB interface protocol?
ma...@googlemail.com <ma...@googlemail.com> #40
Can't help you with your driver problem mate but:
i fixed my app to show directories and images by using the method
MediaScannerConnection.scanFile(this,new String[]{ file.getAbsolutePath() },null,null);
mentioned above. Just do the scan on the images, not on the directories! It will create empty files instead of your directories but when you scan the images inside the directories only, the directories will magically appear too.
Still no workaround for textfiles though.
i fixed my app to show directories and images by using the method
MediaScannerConnection.scanFile(this,new String[]{ file.getAbsolutePath() },null,null);
mentioned above. Just do the scan on the images, not on the directories! It will create empty files instead of your directories but when you scan the images inside the directories only, the directories will magically appear too.
Still no workaround for textfiles though.
ma...@googlemail.com <ma...@googlemail.com> #41
Ok workaround for text files:
For every update i delete the log file and rewrite the whole file new with the appended new data. Before rewriting i delete the file from index and readd it after writing the updated file.
And now after unplugging and plug in the usb cable back again my text file is updated. Now my application works.
Thanks Google.. Thanks for nothing!
For every update i delete the log file and rewrite the whole file new with the appended new data. Before rewriting i delete the file from index and readd it after writing the updated file.
And now after unplugging and plug in the usb cable back again my text file is updated. Now my application works.
Thanks Google.. Thanks for nothing!
ro...@gmail.com <ro...@gmail.com> #42
Neither rebooting, or the MEDIA_MOUNTED broadcast fix this issue. The "Scan SD Card" feature is not available in my settings menu. Disconnecting the USB cable and connecting again has no effect.
So I can confirm:
- the issue occurs right after rebooting
- the issue occurs both on my SD card and my internal storage
- If I want to copy a file from my phone the chance of it actually showing up via MTP is about 50/50. In other words, MTP is completely useless at the moment.
So I can confirm:
- the issue occurs right after rebooting
- the issue occurs both on my SD card and my internal storage
- If I want to copy a file from my phone the chance of it actually showing up via MTP is about 50/50. In other words, MTP is completely useless at the moment.
pu...@gmail.com <pu...@gmail.com> #43
I've stumbled across another workaround for refreshing Android text files in Windows Explorer:
Suppose I have a text log file on the Android device: /path/to/my/logfile.txt
Append some text to the file; Windows Explorer doesn't update.
Execute the following adb command from a command prompt (assumes adb is in PATH):
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
adb gives the following output:
Broadcasting: Intent { act=android.intent.action.MEDIA_MOUNTED dat=file:///sdcard }
Broadcast completed: result=0
At this stage the files in Windows Explorer still haven't updated. The final trick for me is to rename the log file from Windows Explorer. Now the Explorer properties are up to date and the full contents are visible.
This workaround is a bit clumsy but at least it's faster than rebooting the Android device.
Suppose I have a text log file on the Android device: /path/to/my/logfile.txt
Append some text to the file; Windows Explorer doesn't update.
Execute the following adb command from a command prompt (assumes adb is in PATH):
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
adb gives the following output:
Broadcasting: Intent { act=android.intent.action.MEDIA_MOUNTED dat=file:///sdcard }
Broadcast completed: result=0
At this stage the files in Windows Explorer still haven't updated. The final trick for me is to rename the log file from Windows Explorer. Now the Explorer properties are up to date and the full contents are visible.
This workaround is a bit clumsy but at least it's faster than rebooting the Android device.
wh...@gmail.com <wh...@gmail.com> #44
Well, not exactly 50/50,but related to what API created the file (jdk/ndk).
At least, thisis what some folks here suggested after some testing
At least, thisis what some folks here suggested after some testing
ch...@gmail.com <ch...@gmail.com> #45
Same issue happening on Nexus 6P, Stock, Unmodified - MTC20F
Decided to backup all data, wipe and update to Android Nougat , Took me way too long to find a workaround,
If anyone is looking for a workaround just clear data for "Media Storage" app and run the Media Scan command again (Or there are a few apps on the Play Store that would do the same). Works fine after that.
Decided to backup all data, wipe and update to Android Nougat , Took me way too long to find a workaround,
If anyone is looking for a workaround just clear data for "Media Storage" app and run the Media Scan command again (Or there are a few apps on the Play Store that would do the same). Works fine after that.
ll...@gmail.com <ll...@gmail.com> #46
Confirmed issue (c'mon google guys, it's almost 2017!) on Asus Zenfone 2 Laser(ASUS_Z00LD), Android 6.0.1, not rooted.
I have some directories inside the default folder "Movies". All directories are displayed correcly when I access using any Android app, but when I connect it to USB on PC (Windows 8.1), the Windows Explorer don't show me all the directories inside the "Movies".
Important note: To me, rebooting doesn't fix the issue.
I have some directories inside the default folder "Movies". All directories are displayed correcly when I access using any Android app, but when I connect it to USB on PC (Windows 8.1), the Windows Explorer don't show me all the directories inside the "Movies".
Important note: To me, rebooting doesn't fix the issue.
am...@gmail.com <am...@gmail.com> #47
This is nuts, I'm using a Nexus 6p with 7.0.
USB file transfer doesn't see new files/directories.
I can use the FTP server tool from within "Solid Explorer" and I can transfer the files that way -- other than that, I need to reboot before my Linux file explorer can see the files (nemo on Linux Mint).
USB file transfer doesn't see new files/directories.
I can use the FTP server tool from within "Solid Explorer" and I can transfer the files that way -- other than that, I need to reboot before my Linux file explorer can see the files (nemo on Linux Mint).
fm...@gmail.com <fm...@gmail.com> #48
Still an issue on Moto G Plus w/Android 6.0.1 and Windows 10.
jj...@gmail.com <jj...@gmail.com> #49
The MediaScannerConnection.scanFile trick works for this purpose. However, if the user quits the app before the scan finishes, connection leak occurs, logged as:
E/ActivityThread: Service (calling service) has leaked ServiceConnection android.media.MediaScannerConnection@(some hex) that was originally bound here
android.app.ServiceConnectionLeaked: Service (calling service) has leaked ServiceConnection android.media.MediaScannerConnection@(some hex) that was originally bound here
which seems to be related to another bug ( Issue 36949180 ).
E/ActivityThread: Service (calling service) has leaked ServiceConnection android.media.MediaScannerConnection@(some hex) that was originally bound here
android.app.ServiceConnectionLeaked: Service (calling service) has leaked ServiceConnection android.media.MediaScannerConnection@(some hex) that was originally bound here
which seems to be related to another bug (
am...@gmail.com <am...@gmail.com> #50
This continues to be a problem with Nexus 6P on 7.1.1 -- the latest update. Come on Google, thought this was assigned for a fix long ago. This simply is not good enough!
th...@gmail.com <th...@gmail.com> #51
Hi, power user here, not developer. Thought I'd give an example. Might be useful, might just prod the Devs along. Either way, I hope this helps.
Phone: LG v20, stock Android N, only onboard storage (no sdcard)
Car: 2011 Chevy Cruze
I use the AntennaPod app to download my podcasts and listen in the car. Phone is connected through USB cable, and I allow an MTP connection to the car. The car will only enumerate the audio files that have been on my phone since the last reboot. So the flow is Download Podcast, reboot phone, connect to car. After a reboot, I have to wait 2 minutes or so for it to build the MTP file system. Or at least that's what I gather from "This action can't be done while the device is compiling" when I try to play a file soon after a reboot. Note:"Compiling" may not be the exact word used, but it's the same idea.
Please let me know if I can do any more to troubleshoot this with you,
Thanks,
thewisefool89
Phone: LG v20, stock Android N, only onboard storage (no sdcard)
Car: 2011 Chevy Cruze
I use the AntennaPod app to download my podcasts and listen in the car. Phone is connected through USB cable, and I allow an MTP connection to the car. The car will only enumerate the audio files that have been on my phone since the last reboot. So the flow is Download Podcast, reboot phone, connect to car. After a reboot, I have to wait 2 minutes or so for it to build the MTP file system. Or at least that's what I gather from "This action can't be done while the device is compiling" when I try to play a file soon after a reboot. Note:"Compiling" may not be the exact word used, but it's the same idea.
Please let me know if I can do any more to troubleshoot this with you,
Thanks,
thewisefool89
mz...@gmail.com <mz...@gmail.com> #52
Is any one looking into this damn issue?! After so much time it is still present. Screw all new API levels if you can't fix such an old problem. What the hell are you actually working on?
qd...@gmail.com <qd...@gmail.com> #53
I'm still having this issue on 7.1.1
al...@googlemail.com <al...@googlemail.com> #54
I ran into this years ago and could hardly believe it then. Now, writing a new app, Android 6, and it's still there. This is utterly ridiculous! Forget device unlocking by smell or whatever nonsense you're working on - fix BASIC FUNCTIONALITY.
pi...@gmail.com <pi...@gmail.com> #55
When I posted here exactly a year ago (#22) to share my workaround, I wasn't holding my breath this would be fixed in 2016. In retrospect, I'm glad I didn't. We're now entering the 5th year this simple issue remains unresolved. Congratulations G***e, your arrogance is unmatched.
Meanwhile, happy 2017 everyone.
Meanwhile, happy 2017 everyone.
do...@gmail.com <do...@gmail.com> #56
Wow, can't believe this is still assigned, despite its high priority rating.
That's a pity
That's a pity
ro...@gmail.com <ro...@gmail.com> #57
Another note, if you ever *move* files instead of *copying* them, this will cause data loss. The files on your phone get removed, but you'll get a lot of files with 0 size on your computer.
an...@googlemail.com <an...@googlemail.com> #58
I have the same Problem! My customers are complaining frequently about htis!
Additionally I have the problem, that on some devices the folders created by my App are shown as single files (and can't be opened for that reason) !?!?!?
Every little stupid USB Stick does this better than Android!!
Please bring back the Mass-Storage-Mode!
...or solve the issue somehow, but NOW please!
Thanks!
Additionally I have the problem, that on some devices the folders created by my App are shown as single files (and can't be opened for that reason) !?!?!?
Every little stupid USB Stick does this better than Android!!
Please bring back the Mass-Storage-Mode!
...or solve the issue somehow, but NOW please!
Thanks!
dr...@gmail.com <dr...@gmail.com> #59
I am also affected by this issue. Stock Moto X 2nd Gen.
This issue has been around since at LEAST 2014. It's pretty disgraceful that it still exists 2-3 years later. :(
This issue has been around since at LEAST 2014. It's pretty disgraceful that it still exists 2-3 years later. :(
ai...@gmail.com <ai...@gmail.com> #60
I'm also affected by this issue.
aa...@gmail.com <aa...@gmail.com> #61
I'm affected by this issue, Moto G4 Android 6.0.1.
no...@gmail.com <no...@gmail.com> #62
Anyone considering defecting from Android due to this should be aware: I am unable to duplicate this issue on my Samsung Galaxy S7 with Android 6.0.1.
s....@gmail.com <s....@gmail.com> #63
Have the same problems with Xiaomi MI 3s Pro on 7.1.1 - what a shame to have such an old bug still ignored!
jo...@gmail.com <jo...@gmail.com> #64
lol five years on an this is still an issue
gg google
gg google
de...@gmail.com <de...@gmail.com> #65
I face this every time I try to backup my Nexus 5X. This bug is infuriating and embarrassingly long-lived.
dr...@gmail.com <dr...@gmail.com> #66
Set a reminder to myself to return to this issue in a year. Bet it still won't be fixed, lol.
pa...@gmail.com <pa...@gmail.com> #67
I'm adding my voice to this, because it is ridiculous that it hasn't been fixed yet. It causes endless problems.
ma...@gmail.com <ma...@gmail.com> #68
I'm no developer so maybe I can be wrong, but it was so much simplier with USB Mass Storage, just plug, do your stuffs, eject, unplug and it's done. So why create this MTP protocol? What does it add over USB Mass Storage? Why the "new thing" is worse than the "old thing"?
I had starred this issue in the previous issue report, like 3 years ago, and today I come here to star it again. I still can't understand why in 2017 I have to wait like 5 minutes for my phone to reboot and re-scan everything just to copy 2 files?
So, please fix this damn issue, or if you don't know how to fix it, give us back USB Mass Storage, at least it was working everywhere all the time.
I had starred this issue in the previous issue report, like 3 years ago, and today I come here to star it again. I still can't understand why in 2017 I have to wait like 5 minutes for my phone to reboot and re-scan everything just to copy 2 files?
So, please fix this damn issue, or if you don't know how to fix it, give us back USB Mass Storage, at least it was working everywhere all the time.
ba...@gmail.com <ba...@gmail.com> #69
I'm adding my voice to this issue. It was much more comfortable to use USB Mass Storage.
I'm an android developer and I need to deliver Context object everywhere I create files.
Calling MediaScannerConnection every time I create a file is definitely crutches.
I'm an android developer and I need to deliver Context object everywhere I create files.
Calling MediaScannerConnection every time I create a file is definitely crutches.
lo...@gmail.com <lo...@gmail.com> #70
This bug keeps corrupting files because edit is still broken. Given that this is an issue with their JAVA API, why can't Android engineers use JNI internally to invoke the C methods?
ti...@gmail.com <ti...@gmail.com> #71
Issue for this bug in Google Android MTP implementation in media storage component was reported in 10/2012. Now is 5/2017. Four years of users frustration and still no update from Google?!
fe...@gmail.com <fe...@gmail.com> #72
I could be missing something, but it seems like a simple fix for this would be to always update the media database when MTP first connects to a computer...?
If there's some reason that wouldn't work, could we have some other way of triggering it short of a reboot (which in my experience doesn't always work anyway)?
If there's some reason that wouldn't work, could we have some other way of triggering it short of a reboot (which in my experience doesn't always work anyway)?
pa...@gmail.com <pa...@gmail.com> #73
"… a simple fix for this would be to always update the media database when MTP first connects to a computer…?"
Unfortunately, that won't work. Sometimes I connect and the MTP is correct. But if there are subsequent changes in the phone, the MTP fails to report the changes. A reboot sometimes works, and sometimes it doesn't. It all seems entirely arbitrary, but sadly it fails more often than it succeeds.
The only reliable workaround is to use an FTP application to connect to the desktop or laptop. It's not a great solution, because the speed of connection is significantly slower, which is important if you have taken many photographs and videos.
Unfortunately, that won't work. Sometimes I connect and the MTP is correct. But if there are subsequent changes in the phone, the MTP fails to report the changes. A reboot sometimes works, and sometimes it doesn't. It all seems entirely arbitrary, but sadly it fails more often than it succeeds.
The only reliable workaround is to use an FTP application to connect to the desktop or laptop. It's not a great solution, because the speed of connection is significantly slower, which is important if you have taken many photographs and videos.
da...@googlemail.com <da...@googlemail.com> #74
It seems like an actual simple fix would be to force enable usb mass storage mode, or allow the end user to do so.
dr...@gmail.com <dr...@gmail.com> #75
^ That *should* be the default way to connect, IMO. I haven't seen any benefit from MTP, and Google isn't gaining any goodwill by constantly ignoring this bug either.
My personal workaround is to use a 3rd party app (media.Re.Scan as someone above suggested) to correctly rebuild the MTP entries. It works quite well, but I'd really prefer not to use a 3rd party app to fix something that Google broke in the first place. :P
My personal workaround is to use a 3rd party app (media.Re.Scan as someone above suggested) to correctly rebuild the MTP entries. It works quite well, but I'd really prefer not to use a 3rd party app to fix something that Google broke in the first place. :P
an...@googlemail.com <an...@googlemail.com> #76
Every stupid USB Stick manages to provide easy access to files, but Android
phones can't! Even after years of development they are stupid like a loaf
of bread.
Am 16.05.2017 20:25 schrieb <buganizer-system@google.com>:
phones can't! Even after years of development they are stupid like a loaf
of bread.
Am 16.05.2017 20:25 schrieb <buganizer-system@google.com>:
pp...@gmail.com <pp...@gmail.com> #77
Isn't the fundamental problem of the mass storage mode that one has to unmount the whole partition before offering it out as a usb mass storage device? One could unmount an SD-card, but it doesn't seem too possible for the "phone memory" unless it is partitioned even further which creates its own issues. I might hazard a guess that disk encryption would make another obstacle. The obvious solution is to offer a file server instead. They picked MTP as the protocol, but I just cannot understand how it can be so hard to make it work.
I think there is even less hope for getting mass storage mode back than there is getting the MTP server fixed. Maybe a whole new file server...
I think there is even less hope for getting mass storage mode back than there is getting the MTP server fixed. Maybe a whole new file server...
mu...@gmail.com <mu...@gmail.com> #78
I completely agree with you, I would love mass storage for SD card
because it is much more useful that MTP. and there is no good reason
against that.
MPT is very limited protocol and almost useless for file management
especially in windows. It is the singular way offered by android to move
the data and it does not work! Shame on Google!
By the way FTP is not an alternative. The classic windows file sharing
would be, but that is not supported.
On 16.5.2017 21:58, buganizer-system@google.com wrote:
because it is much more useful that MTP. and there is no good reason
against that.
MPT is very limited protocol and almost useless for file management
especially in windows. It is the singular way offered by android to move
the data and it does not work! Shame on Google!
By the way FTP is not an alternative. The classic windows file sharing
would be, but that is not supported.
On 16.5.2017 21:58, buganizer-system@google.com wrote:
do...@gmail.com <do...@gmail.com> #79
Google is the champion of unfinished products. They have a good idea and push it out with bugs that will never get cleared up.
I half think they're pulling an Apple on us, and intentionally making their phones incompatible with other devices. I would recommend they fix this issue though. Not fixing it won't draw people like me into using their devices. I organize my files on Windows--it'd be nearly impossible to do it with the limited functionality of an Android.
I hope Google pays this frustrating issue some attention soon. This should be a very simple fix.
I half think they're pulling an Apple on us, and intentionally making their phones incompatible with other devices. I would recommend they fix this issue though. Not fixing it won't draw people like me into using their devices. I organize my files on Windows--it'd be nearly impossible to do it with the limited functionality of an Android.
I hope Google pays this frustrating issue some attention soon. This should be a very simple fix.
ds...@gmail.com <ds...@gmail.com> #80
It's been like 4 years and I stil have this problem with every version of Android I've used.
The quick fix is easy, have the OS run a delayed MTP media scan upon disconnect and reconnect from USB with appropriate race checking. I can't imagine it'd be more than a few minutes' work to write. Testing might be another story.
The non-quick fix is harder, because this issue seems solely related to Android's implementation of the MTP protocol. MTP is file-oriented and not block-oriented. Metadata is transferred with the files themselves, and transfer is not parallel, so one should theoretically never need to re-scan for updated content. But this also presents a problem when apennding in the case of eg. logfiles - appending would then require pulling the file, updating it, and retransferring the whole file. The MTP extensions try to fix that but aren't consistent because the host's MTPd needs to support them. As for files simply not re-appearing, unless there is a very serious bug in the host's basic MTPd functionality, the culprit is almost certainly a missing or somehow invalid entry in the the MTP file listing.
An entire rescan is overkill - one should try to figure out why entries aren't being written. Downloading the responsibility to applications is fine when the file is being made from a device-hosted APK, but when the file is being transferred via Windows Explorer or Mac's Finder or any file manager on Linux, It is not an "app problem" anymore.
The quick fix is easy, have the OS run a delayed MTP media scan upon disconnect and reconnect from USB with appropriate race checking. I can't imagine it'd be more than a few minutes' work to write. Testing might be another story.
The non-quick fix is harder, because this issue seems solely related to Android's implementation of the MTP protocol. MTP is file-oriented and not block-oriented. Metadata is transferred with the files themselves, and transfer is not parallel, so one should theoretically never need to re-scan for updated content. But this also presents a problem when apennding in the case of eg. logfiles - appending would then require pulling the file, updating it, and retransferring the whole file. The MTP extensions try to fix that but aren't consistent because the host's MTPd needs to support them. As for files simply not re-appearing, unless there is a very serious bug in the host's basic MTPd functionality, the culprit is almost certainly a missing or somehow invalid entry in the the MTP file listing.
An entire rescan is overkill - one should try to figure out why entries aren't being written. Downloading the responsibility to applications is fine when the file is being made from a device-hosted APK, but when the file is being transferred via Windows Explorer or Mac's Finder or any file manager on Linux, It is not an "app problem" anymore.
vl...@gmail.com <vl...@gmail.com> #81
The problem is (likely) that MediaScan does its scan only after reboot. After that it scans only certain directories, like Music and DCIM.
Luckily there are programs that kick MediaScan to do re-scan. Search play market for "media rescan"
Luckily there are programs that kick MediaScan to do re-scan. Search play market for "media rescan"
de...@gmail.com <de...@gmail.com> #82
Wouldn't it be nice if Android worked without having to download some free, ad-serving, full network connections permitted app from a random developer from who knows where just to see your files?
For example - Tape-a-Talk - (great simple recording app by the way)- only old Tape-A-Talk *.wav files show even with MTP option enabled , not the recently recorded ones unless one does a reboot. This is one of reasons some people still don't take Android seriously (and I'm NOT an iPhone fan boy either - wouldn't touch them).
For example - Tape-a-Talk - (great simple recording app by the way)- only old Tape-A-Talk *.wav files show even with MTP option enabled , not the recently recorded ones unless one does a reboot. This is one of reasons some people still don't take Android seriously (and I'm NOT an iPhone fan boy either - wouldn't touch them).
ma...@gmail.com <ma...@gmail.com> #83
Maybe if journalists start to post articles about this unresolved problem that last since 2012, and that people who aren't even aware of the existence of this place start to acknowledge about it, and start to relay the info on social networks etc... maybe then Google will start to take it seriously. What do you all think? Sometimes companies don't move until the problem explodes to the eyes of the bulk.
It's been so many years that I'm facing this issue with multiple Android versions, I paid my devices with the Google OS installed on it, and so it means I paid for something broken, which isn't not fair, especially when this problem has been impacting me almost EVERYDAY for YEARS. I often needs to transfer my last files, and each time I have to reboot, and sometimes it doesn't work, so I reboot again, it's a real pain in the *** and I think after 5 years, we've waited enough and been kind enough towards Google not to make this issue too much public. We have been patient enough.
I'm sure they've spent a huge amount of time developing code on how to track every little thing the user does with his Android smartphone and I'm not sure they've spent the same amount of time to resolve this issue...
It's been so many years that I'm facing this issue with multiple Android versions, I paid my devices with the Google OS installed on it, and so it means I paid for something broken, which isn't not fair, especially when this problem has been impacting me almost EVERYDAY for YEARS. I often needs to transfer my last files, and each time I have to reboot, and sometimes it doesn't work, so I reboot again, it's a real pain in the *** and I think after 5 years, we've waited enough and been kind enough towards Google not to make this issue too much public. We have been patient enough.
I'm sure they've spent a huge amount of time developing code on how to track every little thing the user does with his Android smartphone and I'm not sure they've spent the same amount of time to resolve this issue...
sc...@gmail.com <sc...@gmail.com> #84
If only files that the media server is aware of are available over MTP, why
doesn't the action of enabling MTP on a USB connection trigger a media
server rescan?
On Sat, Jul 15, 2017, 06:25 <buganizer-system@google.com> wrote:
doesn't the action of enabling MTP on a USB connection trigger a media
server rescan?
On Sat, Jul 15, 2017, 06:25 <buganizer-system@google.com> wrote:
mz...@gmail.com <mz...@gmail.com> #85
Because the Google management doesn't care about minorities, they only care about market value. I wonder if the assignee, am...@google.com, is still alive and kicking.
pa...@gmail.com <pa...@gmail.com> #86
> "If only files that the media server is aware of are available over MTP, why doesn't the action of enabling MTP on a USB connection trigger a media server rescan?"
Unfortunately, that won't suffice. Even if you do a media scan and successfully connect to the desktop, when files are subsequently added, deleted or modified, the desktop won't see the changes until after yet another media rescan.
The reason why it isn't done is that a media rescan is required after every file change — add, delete or modify — for the MTP connection to remain up-to-date. On my phone, a media rescan takes at least a couple of minutes. In my case, I often have a couple of dozen changes during my connection. Imagine doing 20-odd media rescans while connected!
There are only two sensible solutions.
1. While connected via MTP, there needs to be a daemon to report every file change as it happens or at least within a couple of seconds. If correctly build, such a daemon would be both quick and low in resource management.
2. Replace MTP with something that works.
Either solution will do the job. Until then, the only reliable workaround is to use an FTP application to connect to your desktop. FTP is unfortunately significantly slower than MTP, but reliability and accuracy are better than speed and errors.
Unfortunately, that won't suffice. Even if you do a media scan and successfully connect to the desktop, when files are subsequently added, deleted or modified, the desktop won't see the changes until after yet another media rescan.
The reason why it isn't done is that a media rescan is required after every file change — add, delete or modify — for the MTP connection to remain up-to-date. On my phone, a media rescan takes at least a couple of minutes. In my case, I often have a couple of dozen changes during my connection. Imagine doing 20-odd media rescans while connected!
There are only two sensible solutions.
1. While connected via MTP, there needs to be a daemon to report every file change as it happens or at least within a couple of seconds. If correctly build, such a daemon would be both quick and low in resource management.
2. Replace MTP with something that works.
Either solution will do the job. Until then, the only reliable workaround is to use an FTP application to connect to your desktop. FTP is unfortunately significantly slower than MTP, but reliability and accuracy are better than speed and errors.
ka...@gmail.com <ka...@gmail.com> #87
An easier and faster method to get up-to-date files from an Android device (then using an FTP-Server-App) are ADB Filebrowsers (there are a few, for example https://github.com/sole/aafm )
lg...@gmail.com <lg...@gmail.com> #88
For F sake google fix that bug
ze...@gmail.com <ze...@gmail.com> #89
Google when you fix this MTP problem?
jd...@gmail.com <jd...@gmail.com> #90
When my app creates a new folder under Pictures and then does the MediaScannerConnection.ScanFile(...) thing, it works fine on the device (visible and usable to other apps), but appears as a 'file' instead of a folder in Windows Explorer. This 'file' can be renamed and deleted but not opened, moved, etc. The work-around in Comment #40 above seems to solve this problem... the trick being to NOT scan the new folder, but rather create a file in the new folder and then scan the file. Now Windows Explorer sees the new folder as a true folder.
lu...@gmail.com <lu...@gmail.com> #91
IMO this is a major bug! How can this be open for 5 years no!!! Just now I transferred my whole photo folder, and then deleted it, only to notice, that all photos since the last phone restart are now gone, because they weren't transferred, because they didn't show up!
he...@gmail.com <he...@gmail.com> #92
Same. Just plugged my Moto G4 Plus into my Lenovo P50 to retrieve some photos. Saw that a huge number of folders was missing. Searched for help. Wound up here.
Nice one, Google.
Nice one, Google.
lg...@gmail.com <lg...@gmail.com> #93
pretty sure nothing will be done in the end ; they have been pushing toward cloud backup for years
ni...@gmail.com <ni...@gmail.com> #94
Still a problem! Moto G4 Android 7.0
ca...@gmail.com <ca...@gmail.com> #95
Mine doesn't even show after restart. I have to create a folder in PC and move the files i want to see inside it, eventually i can see the files in PC.
no...@gmail.com <no...@gmail.com> #96
This will never get fixed by google.
bl...@gmail.com <bl...@gmail.com> #97
Same problem Nougat 7.1.1
Also, cannot rename directory created by USB
Reboot phone to refresh directory seen by USB
Also, cannot rename directory created by USB
Reboot phone to refresh directory seen by USB
mz...@gmail.com <mz...@gmail.com> #98
"Abandon all hope, ye who enter here".
ar...@gmail.com <ar...@gmail.com> #99
I use Xiomi MI4 and in my phone the scanning happens dynamically without the need of reboot, Does anyone have an idea how to find how other manufacturers do it.
fr...@gmail.com <fr...@gmail.com> #100
I can make them files appear with MeadiaScannerConnection.scanFile(); but when i update the file (like its an csv-file and i add new rows) and scann it again. The new rows dont appear.
lo...@gmail.com <lo...@gmail.com> #101
Still an issue on my MotoG5+ running Android 7.0. Doesn't show after reboot either.
eg...@fenixmoviles.com <eg...@fenixmoviles.com> #102
I'm also affected by this issue for years: Huawei G735, MotoG3, MotoG4, Lenovo Vibe K5, Lenovo Tab 7... Android 4.4 - 7.1
ww...@gmail.com <ww...@gmail.com> #103
Suggestion:
Gut the media scanner & have the system write changes directly to the catalog every time a save action is performed; rescanning all media is the wrong approach. If the media catalog hasn't been updated, a "save" hasn't really been completed.
Gut the media scanner & have the system write changes directly to the catalog every time a save action is performed; rescanning all media is the wrong approach. If the media catalog hasn't been updated, a "save" hasn't really been completed.
ch...@gmail.com <ch...@gmail.com> #104
I am facing the same issue on my Motorola Nexys 6, Android 7.1.1. Like others above, I am wondering why this is still not fixed since 2012.
es...@gmail.com <es...@gmail.com> #105
I can confirm this happens on my Huawei P20 after creating a new file. Using the MediaScannerConnection.scanFile() workaround mentioned above, on the newly created file after writing to the file seems to make the file visible.
Rebooting also makes the files appear, there also seems to be other actions that can make previously 'hidden' files appear.
Other apps I have tried have similar issues.
Rebooting also makes the files appear, there also seems to be other actions that can make previously 'hidden' files appear.
Other apps I have tried have similar issues.
op...@gmail.com <op...@gmail.com> #106
As someone who is coding solely a Windows Desktop application and not an Android app.... MTP has made my software look like a joke. I'm using the WPD interface for talking to the device. The afformentioned fixes are anything but for someone like me that isn't even creating an app, yet still wants to read files. I don't have control over how the files are created etc.
Even worse... this bug is so widespread for so long that even if there was an Android update to fix this, so many users are running older versions of Android that this fix will never affect them.
Is there nothing that can be run "Windows-side" that can request a media rescan? Appreciate any magical lines of code that someone has, I will do anything for them.
It's one thing to find a solution for developers to implement for their workspace (dev options, adb, app installs, etc). Completely different and more serious can of worms for actual general users to try and interface with it.
Remind me never to get into Android device. ;)
Even worse... this bug is so widespread for so long that even if there was an Android update to fix this, so many users are running older versions of Android that this fix will never affect them.
Is there nothing that can be run "Windows-side" that can request a media rescan? Appreciate any magical lines of code that someone has, I will do anything for them.
It's one thing to find a solution for developers to implement for their workspace (dev options, adb, app installs, etc). Completely different and more serious can of worms for actual general users to try and interface with it.
Remind me never to get into Android device. ;)
op...@gmail.com <op...@gmail.com> #107
Development*
am...@google.com <am...@google.com>
ig...@gmail.com <ig...@gmail.com> #109
The issue still persists. File renamed from android stock "Files" app (Oreo 8.1) is not visible until phone reboot.
Even worse, 17 GB folder full of files (verified as usable from within Files app and fully usable via adb pull / adb shell) shows as 0 bytes File instead when accessed via MTP.
Even worse, 17 GB folder full of files (verified as usable from within Files app and fully usable via adb pull / adb shell) shows as 0 bytes File instead when accessed via MTP.
st...@gmail.com <st...@gmail.com> #110
The problem still exists on Android 8.1.0. None of the rescan/reboot tricks seem to do it either. Bring back mass storage.
ll...@gmail.com <ll...@gmail.com> #111
Android developers even read this issue tracker?
mo...@runsafe.no <mo...@runsafe.no> #112
If you take a close look, this bug is blocked by a restricted bug. So I am guessing some obscure security issue is to blame for this.
de...@gmail.com <de...@gmail.com> #113
I'd just like to point out that this is *once again* MICROSOFT's fault, not google, for "designing" such a broken and absolutely worthless and useless excuse for a protocol - and i'm not using the "excuse for" expression liberally here. And then forcing it down the entire world's throat, to the point that -get this- even ANDROID and fucking APPLE devices are stuck having to support it along with all its broken piece of shit shenanigans. From a programmer's perspective, i can assusre you - this is NOT FUN to have to put up with.
FFS this "protocol" isn't even DOCUMENTED half correctly by microsoft (if at all - didn't check for at least 3 years) ...and then you all point the finger at google?? come on ppl.....
FFS this "protocol" isn't even DOCUMENTED half correctly by microsoft (if at all - didn't check for at least 3 years) ...and then you all point the finger at google?? come on ppl.....
mo...@hapro.no <mo...@hapro.no> #114
Why not just emulate a plain old usb stick if the protocol is that broken?
de...@gmail.com <de...@gmail.com> #115
... so my first guess would be, google would be facing a lawsuit issue if they reverse-engineered and fully...well, "supported", on microsoft's terms, this MTP protocol :/
de...@gmail.com <de...@gmail.com> #116
> Why not just emulate a plain old usb stick if the protocol is that broken?
Some apps try to do that, the problems are that (1) the app needs root to completely hijack control of the USB port from android, (2) none of them are very reliable (as of yet, at least those i've tested), and (3) most importantly, the FS on your memory card is "mounted" or accessed from 2 different points at once (the android OS, and the app) which can -and often does- lead to severe data corruption.
Why google hasn't implemented such a solution at the linux/android FS level, i can only guess.....
Some apps try to do that, the problems are that (1) the app needs root to completely hijack control of the USB port from android, (2) none of them are very reliable (as of yet, at least those i've tested), and (3) most importantly, the FS on your memory card is "mounted" or accessed from 2 different points at once (the android OS, and the app) which can -and often does- lead to severe data corruption.
Why google hasn't implemented such a solution at the linux/android FS level, i can only guess.....
mo...@hapro.no <mo...@hapro.no> #117
I certainly was not thinking of apps doing it, but android itself.
Surely Google would be better off using well known and well supported methods rather than something so buggy?
Does MTP actually do anything really useful outside giving file system access?
Surely Google would be better off using well known and well supported methods rather than something so buggy?
Does MTP actually do anything really useful outside giving file system access?
mz...@gmail.com <mz...@gmail.com> #118
I strongly disagree here. While MTP itself might be a sorry ass excuse for a protocol, the issue of the file not showing locally, on the device, after it HAS BEEN transferred, it's an implementation issue, it's the skeleton from Google's closet. Typical corporate attitude, screw the minority (not that Microsoft is any better).
hu...@gmail.com <hu...@gmail.com> #119
OMG, since 2012.
The bug still exists :
* Android 8.1.0
* Redmi Note 5
To get work around, i use : AirDroid
The bug still exists :
* Android 8.1.0
* Redmi Note 5
To get work around, i use : AirDroid
fa...@gmail.com <fa...@gmail.com> #120
USB Mass Storage at least worked.
ma...@gmail.com <ma...@gmail.com> #121
I don't think I have anything new to offer, but people do tend to look at the last posts more than the middle posts, so here goes nothing.
USB Mass storage is NOT an option for many phones because they don't have a dedicated mass storage (i.e. SD card) but have unified internal storage where the file storage is in /data/media on the same ext4 filesystem as /data, so it cannot be exported as an USB storage device.
(fromhttps://android.stackexchange.com/a/46321/15789 )
And it just so happens that google is recommending MFRs to integrate this unified storage because it is more secure (it has ext4 file permissions, which fat32 doesn't). They don't even give the user a say in this.
USB Mass storage is NOT an option for many phones because they don't have a dedicated mass storage (i.e. SD card) but have unified internal storage where the file storage is in /data/media on the same ext4 filesystem as /data, so it cannot be exported as an USB storage device.
(from
And it just so happens that google is recommending MFRs to integrate this unified storage because it is more secure (it has ext4 file permissions, which fat32 doesn't). They don't even give the user a say in this.
am...@google.com <am...@google.com>
jo...@trimble.com <jo...@trimble.com> #122
We also face this issue everyday. It's a hassle / pain to have to restart the phone each time to transfer all new files off the device.
On a side note - this doesn't seem to be an issue on some phone such as Samsung Galaxy series from my tests. Seems to work fine on S6, S7, S8 and S9. These Samsung phones always show latest file content (including log) after connecting the phone to PC via USB. Also it always activate USB file transfer when you connect it to the PC (no user action required).
However, Google / Moto / Huawei phone models have this issue and requires the user to reboot the phone. These phones usually put USB in 'charging only' mode and requires user action to initiate USB file transfer.
On a side note - this doesn't seem to be an issue on some phone such as Samsung Galaxy series from my tests. Seems to work fine on S6, S7, S8 and S9. These Samsung phones always show latest file content (including log) after connecting the phone to PC via USB. Also it always activate USB file transfer when you connect it to the PC (no user action required).
However, Google / Moto / Huawei phone models have this issue and requires the user to reboot the phone. These phones usually put USB in 'charging only' mode and requires user action to initiate USB file transfer.
jo...@trimble.com <jo...@trimble.com> #123
After doing some experimentation on this today, I found doing the following worked for me.
1) Call MediaScannerConnection ScanFile method on the desired file (not folder) and wait for the scan to be completed.
This makes the file visible on my PC (including the folder). But the content doesn't get updated. For new files this is typically 0 bytes.
2) After the scan is completed, rename file to something else (i.e add a .tmp extension)
3) Then rename file back to original file name
And now the content is updated. And I don't need to re-plug the phone nor restart it to see the updated content on my PC. File rename is also cheap enough on performance.
I'm interested to know if this works for others who has this problem.
1) Call MediaScannerConnection ScanFile method on the desired file (not folder) and wait for the scan to be completed.
This makes the file visible on my PC (including the folder). But the content doesn't get updated. For new files this is typically 0 bytes.
2) After the scan is completed, rename file to something else (i.e add a .tmp extension)
3) Then rename file back to original file name
And now the content is updated. And I don't need to re-plug the phone nor restart it to see the updated content on my PC. File rename is also cheap enough on performance.
I'm interested to know if this works for others who has this problem.
jo...@trimble.com <jo...@trimble.com> #124
Just to add - this is what I'm doing and works for me. I'm using Xamarin
public void OnScanCompleted(string path, global::Android.Net.Uri uri)
{
try
{
//workaround to file content not being updated on PC
System.IO.File.Move(path, path + ".tmp");
System.IO.File.Move(path + ".tmp", path);
}
catch (IOException)
{
//log error
}
finally
{
this.msc.Disconnect();
this.msc.Dispose();
}
}
I'm not sure what System.IO.File.Move actually does on Android.
public void OnScanCompleted(string path, global::Android.Net.Uri uri)
{
try
{
//workaround to file content not being updated on PC
System.IO.File.Move(path, path + ".tmp");
System.IO.File.Move(path + ".tmp", path);
}
catch (IOException)
{
//log error
}
finally
{
this.msc.Disconnect();
this.msc.Dispose();
}
}
I'm not sure what System.IO.File.Move actually does on Android.
sa...@google.com <sa...@google.com>
sa...@google.com <sa...@google.com>
cc...@google.com <cc...@google.com> #125
Thanks for your feedback. Engineering team has confirmed the issue has been fixed. If you are able to reproduce the issue, please file a new bug https://goo.gl/TbMiIO with reference to this bug.
sc...@gmail.com <sc...@gmail.com> #126
Eight years... better late than never, I suppose.
Description
However, the issue is STILL a problem and it is STILL frequently reported by users (as can be seen by the comments in
I demand that Google actually takes actions on this. This is an Android-wide problem. I work with end users a lot, for mobile data collection & such. You can't just write in your SOP "well, just restart your phone whenever you need to access data... yes I know, that may mean 10 times a day, but...".
Original text below. Sorry guys, but you can't just get ride of issues without fixing them by marking them "Obselete".
==========================================
All phones using MTP instead of USB Mass storage do not properly show the list of files when that phone is connected to a computer using a USB cable. Android apps running on the device also cannot see these files.
This affects files written using Java APIs, but does not appear to affect files written using the C API.
The solution is to reboot the device.
STEPS TO REPRODUCE
- Write to and close a file using Java APIs.
- Do the same thing using C APIs.
- Connect the phone to a Windows computer using MTP.
WHAT HAPPENED
- Files written using Java cannot be viewed by Windows; in fact, they cannot even be viewed by some other Android applications running on the same device! They can be viewed only by the app that created the files, UNTIL the device is restarted.
- Files written using C can be viewed just fine.
- This behavior can be observed with many applications freely available from the marketplace.
EXPECTED BEHAVIOR
- MTP should work like USB Mass storage mode, where there are currently no problems and files are visible right away without a need to restart the device.