Android Studio - Device File Explorer: Permission denied - android-studio

I am trying to access the Device File Explorer but I keep getting Permission denied. Have not been able to find a solution online anywhere. Any help would be greatly appreciated!
Android Studio photo

I had a similar problem: I could not access storage\emulated because it kept telling me that I had no permissions.
I found no answers on internet, but I created a new emulator (Nexus_One) with android's version lollipop (5.1), and at first I did not find any directory inside storage. I right clicked, selected upload and uploaded a file. Then I could see all the directories inside storage. I right clicked on emulated, uploaded a file, and finally got the directory 0 where I needed to upload the real file.
However, this trick did not work on the emulators I already had (Nexux 5).
It is not a solution, but I hope it helps!

'/storage/emulated/0/' like a abstract path, you can upload file on sdcard/,and visit it use '/storage/emulated/0/' in android code.For example,if you want to visit a test.txt in '/storage/emulated/0/myFiles/test/test.txt'(code path), you should upload the test.txt in 'sdcard/test/test.txt'(in Device File Explorer,AS).

Related

Google Drive XLSX File not readable anymore (Rescuing corrupted file)

I had created a google sheets (xlsx file) for my studies and after I finished the studies, stored it on pcloud and deleted on Google Drive.
Upon trying to open it on pcloud, I just noticed, it's corrupted. pcloud claims there is a password protection, but there shouldn't (as I didn't set any).
So I asked my file to be restored from Google Drive (as it was already deleted permanently) and was able to get it restored. However it's also not openable there anymore.
Since the file still contains some mb of size and somewhat text (if I try to open with Visual Studio Code it contains what seems to me wrongly encoded), I am wondering if there is really no way to restore it somehow.
Please find attached an example of how the file looks in Texteditor:
If you have any idea how I could try to restore it, I would be thankful for any kind of help. (Pcloud and Google Support weren't)
I am using:
MAC OS Monterey
File was downloaded from Google Drive (Chrome & Safari tested)
Tried to open it with: Google Drive, Numbers (MAC), CotEditor, Visual Studio Code
Thank you and sorry!

Can't create Sample Data Directory - Android Studio

I"m trying to Create a sample data directory, using Android Studio, by clicking on app in the project view and then right mouse click to find the menu item New > Sample Data Directory.
It is not working.
Creating the directory via android studio doesn't always work. You may need to create the directory manually in your directory structure (at /app/sampledata/) without using Android Studio. Once you create it (e.g., via Windows Explorer) it should show up in Android Studio. See the the following answer for more information about sample data in general: How to put new placeholder resources into Android Studio project ("tools:sample" resources)?
"Unlike resources like images, fonts, etc. The sample data does not go in /res/ (they are not compiled with the app, hence. It is probably easier to filter them out by putting them in a totally separate directory). They go in /app/sampledata/, for example: /app/sampledata/image.png."
You can create a sample data directory in Android Studio itself by following the below steps:
Change the view of directory structure from Android to Project as follows
Right click app folder and select New->Directory
Finally, give a name to your directory, in your case, it should be sampledata
I have already created sampledata directory that's why it says "Directory already exists".
That's it. You have done it. Remember that Android Studio also supports loading sample data from a json file. All you have to give is fully qualified name of the key residing in the json file.
Ex- if your json file contains key name inside a Json Array student, then you have to specify it as "#sample/your_student_file.json/student/name" to use values present in key name.
Unless your issue happens to be different, this is a known issue that only affects Windows. As I've found, it has something to do with 'C:\' in the file path.
https://issuetracker.google.com/issues/124553391
As Shawn mentioned, you need to manually create the directory.
I've been unable to get the images to actually display in the previewer, which I suspect may also be caused by the file path bug.
Inside the app folder in file explorer, You can create a new folder (sample data) which will be reflected in your android studio.

How to stop Google Drive creating desktop.ini files

I'm doing a school coding project using Android Studio with Google Drive to store my app files. Google Drive is generating these desktop.ini files. Every time I delete or modify them, they are regenerated, even when I shut down Google Drive. How can I fix this? I cannot run or debug my project with this error.
As a matter of fact the desktop.ini file is created only in Google Drive folder. So you can't blame it on Windows. If it is Windows, then the file should be everywhere. Also, if you open the desktop.ini in Notepad you will see the following lines:
[.ShellClassInfo]
InfoTip=This folder is shared online.
IconFile=C:\Program Files\Google\Drive\googledrivesync.exe
IconIndex=16
See InfoTip and IconFile. There is no way Windows would be doing this.
I got my solution:
1)Open ini file's Property Dialog
2)Hide this file in System File way,use this cmd:attrib +h +s "D:\Google Docs\desktop.ini" /s /d
3)Deny all Access Privilage in Property Dialog,like this:
4)Just refresh folder!
Desktop.ini files are generated by Windows, not Google Drive. When you open a folder in Windows, it creates a desktop.ini file. The desktop.ini file stores the view settings for that folder.
As to why you are getting build errors in Android Studio simply because this file exists, I can't answer at the moment. I have successfully built many Android projects in Android Studio with that file in the folder.

"This file is currently not available for use on this computer"

I am hoping someone has had this issue before and can help me resolve. I was working on a company project. I had just finished up and needed to publish my project to the server. When trying to publish, I got the error "This file is currently not available for use on this computer."
So then I tried to open one of the .cs files of the solution, and the error occurred again from trying to open the file. So I tried to grab the latest version from TFS thinking it would give me whichever file is missing, but when I click "Get Latest Version" on the project, the error message pops up there too.
I thought surely I will be able to delete the project locally and then remap it, but I can't even delete the project off my computer, as the error message pops up halfway through deletion. When it occurs there, however, I do get "Error 0x800710FE: This file is currently not available for use on this computer."
Also have tried deleting offline cached files through Control Panel > Sync Center > Manage Offline Files > Disk Usage > Delete temp files
I got this error for a small, test solution that was not using TFS. The default file location is the documents folder, which in my environment is synced using the Sync Center. I moved all of the solution files to a new local folder that was not included in Sync operations and the error went away.
Conclusion: storing VS files in a folder managed by Sync Center is likely a bad idea.
I got this error when trying to save an excel file served from a webpage.
The solution for me was to save it under a different filename. Possibly because I previously had a file with the same name open in excel.

VS2012 Error when creating publish package: Exception in Executing Publishing Access to path is denied

I am trying to publish an application with VS2012 and when i try and make the package i get an error that access to the path is denied. I have checked and my user has full control and verified the path.
VS is trying to access .pubmxl file that is there.
I have also tried running VS2012 as administrator.
I had this same issue (VS2012: Access to path is denied when executing publish) and found a way to allow Visual Studio access to the file.
If you open the pubxml file in Visual Studio, make an edit, and save the file, Visual Studio is able to successfully publish using that file. Hope this works for you too.
Creating a new profile worked for me. I got this error when I tried to change the path of an existing profile, and Unfortunately I could not find the original pubxml file, otherwise I would have simply copied it to the new location and followed advice #1 (edit the file in location from VS2012). It's easy enough to create a new profile as there aren't many settings anyway.
I have experienced this issue and I noticed that the files were "Read-Only". Selecting the files and removing the "Read-Only" attribute allowed me to Publish successfully.
Sounds like TFS feature rocks again. Remove publish profile from local repo and get latest version afterwards, then you should be fine.
I had the same problem and fixed it by removing my Publish profile and creating a new one.

Resources