How do i add local database file to my appstore build?

Hello, apple developers community!

I have an app which I submitted to apple review, and it was rejected because of "crash on startup".

I was investigating crash logs, device console for ad-hoc build and finally came to conclusion it is failing due to inability to open a local .db file.

I checked it further and found:
  • for development build, I have "tasksolver.db" file in my bundle, and it is successfully copied into real device or any simulator

  • for ad-hoc or appstore archive, this file is not added and is missed in the package, so app is failing on first startup with a fatal error while trying to copy it from bundle to documents folder.

Was digging the internet for advices (and I am still on it), but so far I am missing the answer.

I have file in my project (among other files, like a code .swift ones, on the navigator right pane), I have only 1 deployment target and the checkbox is on for the file, it is listed in development assets in target/general tab, and it is listed in build settings / deployment section.

No idea on what is the difference between simulator build from Xcode and ad-hoc/appstore archive in this matter.

Any help is appreciated!

Cheers,
Andrey
Answered by ForumsContributor in
Accepted Answer
I was able to sort out the issue by removing asset from project and adding it back. Seems like I had some sort of issues with my previously added assets, no idea what was it, but still removing/adding it helps. Issue can be now closed.
How do i add local database file to my appstore build?
 
 
Q