Build Step - Copy Files: Doesn't copy files

This is my first experience with Build Step - Copy Files, and it isn’t working.

I followed the example to deploy a desktop app with a SQLite database file, made sure to add the db-file to the build step and compiled the project.

However the db-file wasn’t copied to the ressource-folder of the compiled file and the program (obviously) failed to connect to the database.

After I added the db-file manually to the ressources-folder of the compiled app everything works as supposed.

Did I make an error somewhere?

You need to move the step to the macOS folder. I don’t really know why the copy steps are created at the wrong location.

While it looks like what you’re doing is right, don’t access the database from your application, while it is in the resources folder.

Opening a database in Xojo, opens it as read/write, which will cause problems down the road. Instead copy the database from the resources folder, to the application support folder and edit it there.

I tried every alternative:

Nothing worked.

@Beatrix_Willius Did you mean something else?

I’m not using the db in the ressource folder.

The “Copy Files” step does not copy the db-file to the compiled project so it isn’t found and can’t be copied as “working db” to the location on the harddrive, when starting the app for the first time.

Your CopySQLIte step needs to appear in in the macOS build settings. Example using a copy step called CopyFiles1:

Screenshot 2022-10-29 at 3.02.59 AM

1 Like

Screen Shot 2022-10-29 at 4.09.12 PM

1 Like

Sam is correct. While you can copy the database to the Resources folder you then either have to copy it somewhere else when you want to use the database. And in this case you can create the database from scratch with SQL anyways.

1 Like

OMG! Simple. Thanks!

1 Like