0

I am building a web app + an hybrid Cordova app.

From what I read, it is best to provide relative paths to Cordova. I first had an issue with this solution but solved in using the <base> tag, and almost everything works fine now.

Scripts and stylesheets load just fine on both my web app and my hybrid app. However images do not. They refuse to load properly on the mobile app.

Here are some examples to be more specific, taken from Chrome's device inspector :

Scripts

<script src="library/js/libs/require.js" data-main="library/js/dependencies.js"></script>

This is properly resolved by the hybrid app, the file is loaded properly. However, if I try to load an image using the same relative path logic :

Images

<img src="library/images/mvp/user_default_avatar.png">

This is not resolved properly, the image isn't loaded. Any suggestion as to why I am facing this inconsistant behaviour ?

Community
  • 1
  • 1
Alexandre Bourlier
  • 3,972
  • 4
  • 44
  • 76

1 Answers1

1

I faced the same problem sometime ago. Correct tag, scripts and sylesheet being loaded successfull... But images do not, even with everything looking right.

You tried to load another image of a different extension, like JPG? Sometimes the .png images may be corrupted and need to be reviewed before save.

Hope it helps! Best regards.

Cordovaing
  • 301
  • 1
  • 8
  • Thanks for your answer. Sorry for reaching back this late, many other stuff came on the pipe. I am still facing the issue. I'll try to play with images but... it seems to be that it is a path issue. My images load fine in a browser. But I'll double check and keep playing with it. At some point it will work obviously :) – Alexandre Bourlier Feb 18 '16 at 17:32