# Loading images from subfolders

**URL:** <https://discourse.processing.org/t/loading-images-from-subfolders/14140>\
**Category:** Processing for Android\
**Created:** [September 23, 2019, 5:47pm UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140 "2019-09-23T17:47:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [September 23, 2019, 5:47pm UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140/1 "2019-09-23T17:47:04Z")

</div>

I am developing a game in android and have a lot of images that I need to load, so its much easier for me to use subfolders, but when attempting to load an image in a subfolder, I get this error:  
`java.lang.IllegalArgumentException: File example/aaa/0.png contains a path separator`

The project works perfectly fine in normal processing, so I have no idea why this isnt working.  
Can I not use subfolders in processing for android?

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [September 23, 2019, 6:10pm UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140/2 "2019-09-23T18:10:39Z")

</div>

It could be you are not supplying an absolute path?

---

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [September 23, 2019, 6:37pm UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140/3 "2019-09-23T18:37:29Z")

</div>

what do you mean by an absolute path?  
All images and paths are within the data folder if that’s what you mean

---

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [September 23, 2019, 9:35pm UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140/4 "2019-09-23T21:35:01Z")

</div>

To people reading this : try running the sketch in Java, then compiling to Android every time it spits out this error, that solved my issue

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [September 24, 2019, 9:43am UTC](https://discourse.processing.org/t/loading-images-from-subfolders/14140/5 "2019-09-24T09:43:01Z")

</div>

@F53 === i am very surprised: the error exists and i cannot see how you solved it; you are giving a path when android is waiting for a file…
