Emberdded database not in IPA

The problem: The app has a database that is copied during the build process so it is embedded in the Resource folder. Things work fine in the simulator. Things work fine when I install app (the .app file) using Xcode.

Things do not work at my testers who are getting the app via TestFlight. It crashes at start up. I placed some logging statements in the code, and after several days (and more logging statements) I received a log file that indicated the problem was near where the database is opened.

(Skipping some tests,)

I opened the .app file (Show Package Contents), and the database is visible.

Changed the extension of the .ipa file to .zip and unzipped it. Showed Package Contents. The database file is not there. This explains the behavior my testers are seeing.

I can catch the error, but without the database there’s not much point (it contains information necessary for the app to run).

Anyone have any clue or suggestion? Note that the info.plist file is visible.

Is this a bug, and I should report it?

The answer is here: https://documentation.xojo.com/topics/application_structure/mobile/copy_files_to_ios_device.html

The secret is that the CopyFiles step must be before the Sign step. This does not explain the difference between the .app file and the .ipa file. I would expect some consistency.
Further, since the documentation states that Copy Files should happen before Sign, we might expect that the IDE could detect this and report it.

I’ll ship things to testers in the morning.