Images don't show up in the app

  • 1
  • Problem
  • Updated 4 years ago
I'm new to PhoneGap Build and I'm trying to build an app via the Adobe CQ/AEM - PhoneGap integration. So far so good: I can build an app out of my dynamic content but all the images I have on the website don't appear in the app. Instead there is a (?) symbol. Now when I download the ZIP package that's being created by AEM and built by PhoneGap the images actually DO show up and they are part of the zip file. Does anybody have an idea why that could be?

// Edit: Also when I use weinre to debug the app, the image path looks correct (ie. it's the same as in the zip, obviously)
Photo of Paul

Paul

  • 3 Posts
  • 0 Reply Likes
  • confused

Posted 6 years ago

  • 1
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Hi Paul,

Likely causes of image issue could be slow internet and image being too large?

Can't say exactly what the cause it so please provide the app id for the app in question after PGB built it.

Would have a test run of it.


Photo of Paul

Paul

  • 3 Posts
  • 0 Reply Likes
Thanks for the reply.

Aren't the images packaged with the app though, so it shouldn't be impacted by slow internet? The images also seem very small (20 - 30 KB) when downloaded as the Zip package. (...and I'm on a pretty fast wireless)

The app id is: 825178. Let me know if you find anything that's wrong.

Thanks!
Paul

// Edit: I also just tested the app on the simulator. Same problem, the images do not show up.
Photo of Paul

Paul

  • 3 Posts
  • 0 Reply Likes
Another update:

When I unpack the .apk file I can see that the images are not actually there, so it makes sense that they won't display.
Now the question is, why wouldn't they be included in the build? As stated above, when I download the zip generated by the content sync, the images are included and everything works fine.

Is there any kind of rule regarding where the images should live?
An example is here:
(www/)content/geometrixx_mobile/en/company/_jcr_content/par/mobileimage.img.png

Basically the "_jcr_content" folder is not included in the android app for some reason.

When I rename it to "jcr" and upload it to phonegap build again, the newly generated .apk does include it and the images DO show up. So I can't have folders starting with an underscore??

Not sure if that's an issue with PhoneGap or AEM?
Photo of Carlos Cañizares Estévez

Carlos Cañizares Estévez

  • 1 Post
  • 0 Reply Likes
Hi, probably i'm late at the party. I've the same problem but not exactly the same scenario... I solved changing de src of the img in the HTML from this type:

../../img/x.png

To

./img/x.png

And the second way solved my problem.
Photo of sujann kkhatiwada

sujann kkhatiwada

  • 1 Post
  • 0 Reply Likes
My app also doesn't show Images and shows Question mark.What to do?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1. Local images (your app assets) or images from remote server?
2. What PGB version are you using?
3. Do you have a CSP that is blocking them?
4. Are the image paths correct (if IMG element with SRC attribute)? Is the xhr request for them correct (if ajax)?

What to do?
Find the error and correct it.
Without ANY detail about the situation, I can only prepare my crystal bowl in case you come back, stating "I don't understand the questions".