# LibGDX: Shader files in assets - Access is Denied

I stored the glsl files in android -> assets -> shaders directory, but when I run the app, an error is displayed:

Error:Gradle: Execution failed for task ':android:mergeDebugAssets'.
Error: java.io.FileNotFoundException: ...android\assets\shaders (Access is denied)


But the problem goes away if I put those files in assets root folder. Can I not store shader files in asset subdirectories? Using Gdx v1.9.3.

EDIT: The issue is not there when running on Desktop, but only on Android. Didn't check others.

UPDATE: Apparently the issue got resolved today. I didn't make any changes but it's working now!

• What code are you using? Using Gdx.files.internal("shaders/<filename>.glsl") works for me... – JDSweetBeat Jul 13 '16 at 15:19
• Yes, that's how I'm using too. But that error message I mentioned gets thrown. – WeirdElfB0y Jul 13 '16 at 18:02
• Did you use the setup application to target Android initially? If not, you might have made a mistake (logical or otherwise) in the gradle setup. If that is not the problem the only other thing I know to tell you (without looking at the code that causes the exception) is to check for typos and make sure your Android project is configured correctly. – JDSweetBeat Jul 13 '16 at 19:44
• Yes I did that. I selected all target platforms during setup. I will check android gradle file again for any typos. This happens when running on Android, no problem in Desktop. – WeirdElfB0y Jul 14 '16 at 5:52
• Apparently the issue got resolved today. I didn't make any changes but it's working now! – WeirdElfB0y Jul 14 '16 at 6:24

I assume you use Android Studio or IntelliJIdea (don't know how Eclipse works).
These errors happen because of Windows administrative permissions. All you have to do is to open the parent folder (this one where your 'access denied' folder is in) in a windows file explorer. You need to rename the folder to anything you want and name it back with a previous name. If it was folder named shaders, rename it to shaders2 and go back with shaders. IntelliJ/Android Studio will refresh the project itself and it will work.
This is caused by adding files directly to the project, but not to the folder itself ;) Happens to me on Windows10 when running Android Emulator or a normal mobile phone plugged in.