# Weird Ionic Android Image Cache Issue

**URL:** <https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077>\
**Category:** ionic-v3\
**Created:** [January 12, 2018, 5:24pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077 "2018-01-12T17:24:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cirravox](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cirravox](https://forum.ionicframework.com/u/Cirravox)\
**Post date:** [January 12, 2018, 5:24pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/1 "2018-01-12T17:24:19Z")

</div>

Hi.  
I’m having a weird issue with images on my production built app on Android:

- When the app is initially installed and ran on the phone, the images show up fine.
- If I close and re-open the app, the images do not show up.
- If I go to my phone’s “Manage Application” option, clear data in storage for that app, then restart, the image shows up again.

I’m not doing anything special. Just an img src=“assets/img/myimage.png”

Does anyone have any idea how I would go about fixing this issue?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [January 12, 2018, 5:47pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/2 "2018-01-12T17:47:00Z")

</div>

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: [https://ionic.zone/debug/remote-debug-your-app#android](https://ionic.zone/debug/remote-debug-your-app#android) Look at the console and network tabs for errors.

---

<div class="post-metadata">

**Author:** ![Cirravox](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cirravox](https://forum.ionicframework.com/u/Cirravox)\
**Post date:** [January 12, 2018, 5:51pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/3 "2018-01-12T17:51:04Z")

</div>

Thanks for the quick reply Sujan!  
I’ll give it a go and update you on the outcome.

---

<div class="post-metadata">

**Author:** ![Cirravox](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cirravox](https://forum.ionicframework.com/u/Cirravox)\
**Post date:** [January 12, 2018, 7:25pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/4 "2018-01-12T19:25:53Z")

</div>

Ok. It seems like the second time I run the app, it’s requesting the file at: file:///data/user/0/assets/myimage.png  
The assets folder nor the file exists in the device storage.

Is this normal behavior for android devices?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [January 12, 2018, 7:27pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/5 "2018-01-12T19:27:28Z")

</div>

Where is it requesting the file on first run?

What is your `ionic info`?  
Are you using Ionic Deploy in your app?

---

<div class="post-metadata">

**Author:** ![Cirravox](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cirravox](https://forum.ionicframework.com/u/Cirravox)\
**Post date:** [January 12, 2018, 7:37pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/6 "2018-01-12T19:37:39Z")

</div>

The first time I launch the app, it’s requesting: file:///android\_asset/www/assets/img/myimage.png

ionic info:

```
@ionic/cli-utils : 1.18.0
ionic (Ionic CLI) : 3.18.0

```

global packages:

```
cordova (Cordova CLI) : 7.1.0

```

local packages:

```
@ionic/app-scripts : 3.1.2
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2

```

System:

```
Android SDK Tools : 26.1.1
Node : v6.12.0
npm : 5.5.1
OS : Linux 4.10

```

Environment Variables:

```
ANDROID_HOME : /home/comp/Android/Sdk

```

Misc:

```
backend : pro
```

---

<div class="post-metadata">

**Author:** ![Cirravox](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cirravox](https://forum.ionicframework.com/u/Cirravox)\
**Post date:** [January 15, 2018, 5:54pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/7 "2018-01-15T17:54:10Z")

</div>

Ok, so your replies helped me to resolving the issue.

So before I manually built for android release, I changed where the resource was pointing to i.e. from …/…/assets/img to assets/img but I did not push the latest changes to Deploy.

So every time I started the app initially, the local resource would be loaded, but behind the scenes, **Deploy would update the link from the old commit**.

All I needed to do was update my commit to the latest and it worked every time.

Thanks again Sujan!

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:55pm UTC](https://forum.ionicframework.com/t/weird-ionic-android-image-cache-issue/118077/8 "2021-07-19T21:55:39Z")

</div>

Closed on July 19, 2021, 9:55pm UTC


