F7 V4 Build Android won't load images and js files

Hi everybody,

I started my project with Framework7 CLI and I developed the app and everything works fine when I test it with the command npm start the Javascript files and Images loads and works correctly.

The problem is when I compile the app.
I have one single image that won’t load and the Javascript files seems to not be working either (since I can’t perform an action from a button).

I placed my image in the folder /src/static/
I’ve been working only in the myApp/src/ folder since I read this on the readme
“Cordova project located in cordova folder. You shouldn’t modify content of cordova/www folder. Its content will be correctly generated when you call npm run cordova-build-prod.”

Should I copy all the files from the myApp/src/ folder to myApp/www/ folder?

I tried to compile the app with the following commands:
framework7 cordova build android
And also with
npm run build-cordova-android-prod
npm run build-cordova-android-dev

And I had the same results.

Example of how do you reference these static files in your code?

Yes, for example the image like this:

<img src="../static/logo.png" width="200">

And the JS files like this:

<script>
import utils from '../js/login.js';
export default {}
</script>

static folder is the root folder of result package, it should be <img src="static/logo.png" width="200">

1 Like

It works!
The JS files are good with that path.
Thank you very much.