4
\$\begingroup\$

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!

\$\endgroup\$
5
  • \$\begingroup\$ What code are you using? Using Gdx.files.internal("shaders/<filename>.glsl") works for me... \$\endgroup\$
    – Jax
    Jul 13, 2016 at 15:19
  • \$\begingroup\$ Yes, that's how I'm using too. But that error message I mentioned gets thrown. \$\endgroup\$
    – Neerkoli
    Jul 13, 2016 at 18:02
  • \$\begingroup\$ 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. \$\endgroup\$
    – Jax
    Jul 13, 2016 at 19:44
  • \$\begingroup\$ 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. \$\endgroup\$
    – Neerkoli
    Jul 14, 2016 at 5:52
  • \$\begingroup\$ Apparently the issue got resolved today. I didn't make any changes but it's working now! \$\endgroup\$
    – Neerkoli
    Jul 14, 2016 at 6:24

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you. That explains why it got solved automatically the next time I opened the project. \$\endgroup\$
    – Neerkoli
    Nov 30, 2016 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .