Sqlite database/file no longer in ios app build - ios

This may have been my fault, but I am not sure how to fix the issue. I wanted to change the data installed with my app. Instead of modifying the data in the original sql file in the project, I deleted the sql file from my project and added a new one (with the same name).
Now when I run the app in a simulator it cannot find the sql file. The sql file is also not in the local directory where all my simulator run files are.
I have tried cleaning the build, deleting and cleaning and re-adding, etc.., but my sql file fails to be copied to the simulator directory.
When I deleted the file I removed the reference. Where is this "reference"? I suspect that when I try to re-add the file, it doesn't recreate the reference.
I do not want to have to change the name of the database if that can be avoided.
Edit: Adding a screenshot that shows that file is not included in the target (in this case AmeldaiPhone).
After checking the checkbox for the target, the file still does not appear in the simulator directory:
Path to simulator directory:
Contents of simulator directory (where the sql file always showed up before):
Update: I have revised my project file and the sql file still does not show up in the build. I have determined that this is an issue with the specific target, which was created after the sql file was added. The sql file shows up fine in the build of the original development target.

I do not know why this is happening, but I was able to fix my own problem by unchecking the development target for my sql file, and cleaning and building. The file then appears in my deployment target..
Unchecked development target, checked deployment target..
Path to simulator directory:
File appears in simulator directory.
That seemed to unstick whatever weird thing was stuck. The file is now included in all target builds.

Related

unity - xcode build failed with NSUserDefaults.mm file not found message, possibly because com.unity.services.core folder is not in project folder

building an XCode project with an .xcodeproj file generated by unity 2021.3.3f1 fails with the message "Build input file cannot be found: 'users/---/ --project name--/Libraries/com.unity.services.core/Runtime/Device/UserIdProviders/NSUserDefinitions.mm' "
When I look in Finder, I notice that the com.unity.services.core does not exist under the Libraries folder.
Some background. I recently moved to trash many Xcode files to free up disk space. I also did a new remove and Install of XCode, in case I deleted anything important accidentally. Non unity files work fine in XCode.
This might be the first project I used 2021.3.3f1 for. I previously used 2019.4.14f1 without encountering this problem.
Is there something I should set in the IOS Player settings of Unity BuildSettings to avoid this problem? (or something that would force the com.unity.services.core folder to be generated in the output project)?
I am very inexperienced in Mac and infrastructure so I apologize in advance if I am missing something very basic.
Thank you
You should clean your build folders and build anew, should work.
In Xcode you can do this by going to Product > Clean Build Folder, in Unity you just manually delete the whole Build output folder (I hope you created a seperate folder specifically for the Build output and didn't just export to the project directory in that case don't delete your project directory just set a new Build output folder ;).

iOS build time error Asset.xcasset No such file or directory

I'm getting an error while trying to run the app on the simulator, using Xcode 12.4
/Users/apple/Library/Developer/Xcode/DerivedData/CCBC-
exyindmimlkaxncxdeubzcgqxqgc/Build/Intermediates.noindex/CCBC.build/Debug-iphonesimulator/CCBC.build/Script-7DBCCAD36C20635EF76D902C.sh: line 4: /Users/apple/Desktop/MyProjects/CCBC_iOS/CCBC.xcodeproj/xcuserdata/.xcassets/Asset.xcasset: No such file or directory
When I select the Asset.xcasset from files in Xcode it shows the file path as /CCBC_iOS/CCBC/Asset.xcasset
Thanks for your help
For me, I had to delete an old script that references this Asset file to be built within Derived Data. Regardless of how much I deleted Derived Data and cleared Build Folder, this script still runs the XCAssets reproducing this bug. I would recommend checking out your Build Phases and Scripts and removing unnecessary files especially for old projects.

XCode workspace integrity - couldn't load project (pods.xcodepoj)

I pulled from git and everything works fine except I got this error even though I can still run the project. Is there a way to fix this?
This usually means there was a merge conflict that got committed to the actual project.pbxproj file.
Since this is a Pods project (which is ephemeral and can be recreated at will) you can run pod install from the command line (in the same folder as your Podfile and it will regenerate the project.
problem:- Workspace integrity (could not load project) I got the same issue also I hit and try many solutions (Restart mac, Cache data remove, pods update, pods install, etc) but all in vain.
Solution : Once I try to open the project the "Xcode.copy" opened intead of my original Xcode . I just close all projects after that I open the project from selecting Xcode directly from the finder.
Note:- do not go to the project folder then open project from "projectName.xcworkspace"
you just need to go finder(Spotlite search) and open Xcode and open from finder then you must select the desired project. The project will work perfectly and after that you can open project manually (in your folder etc)
:) These things working from my side.

Info.plist not copied to DerivedData causes compilation error in Xcode

I have a problem that cropped up quite recently with a project that has otherwise compiled and built just fine for over a year.
The error I receive is this:
Showing All Issues
Unable to load contents of file list: '/Users/julian/Library/Developer/Xcode/DerivedData/xxxxxxxxx/Build/Products/Debug-iphoneos/OmataRx.app/Info.plist'
There are a couple of peculiar things here.
First, my Info.plist is not named Info.plist. It is named RxInfo.plist and is indicated as such in the Build Settings Info plist File section.
Second, if I go to this directory path, there are no files there whatsoever. Empty directory. So, whatever build phase was attempting to copy the file there, did not do so. But, there is no error or warning of such a step failing.
Third, if I copy my named plist file to that directory, change the name to Info.plist, everything works fine.
Bonkers, eh?
I've tried a variety of things. I've rebuilt after cleaning, I've deintegrated and then re-installed and re-built the Pods. I've gone to Legacy Build System and attempted that. I had a colleague attempt to build from scratch on their system and they had the precise same error. This all happens on Xcode 11.6. On a whim, I tried building with Xcode 12 beta and had the precise same results.
I'm not sure what to attempt next, to be honest. And dragging-and-dropping and renaming the plist file to that Derived Data directory goes against against everything I believe. 🤣
Suggestions are greatly appreciated!

How do I install a replacement database file?

How do I clear out old databases in sqlite3? (version 3.7.12)
I am building an iOS (Xcode) app using sqlite3.
I deleted the dbase file (in /Users/xx/Library/Application Support/iPhone Simulator/6.1/Applications/nnn/Documents). I destroyed the copy in the xcode navigation panel. I trashed the copy in the project bundle. And I removed its reference in Build Phases/Copy Bundle Resources.
As a test, I did not try to put in a new db file. Only the source code remains [[SQFXDB alloc] initWithSQFXDBFilename:#"sqfx_v4b"];.
And build succeeds. And Run succeeds. And the data is still there in the simulator. And a new database file has been created in the ../Documents dir. All the original data is there.
Can anyone enlighten me?
Thanks, Dave
Delete app from simulator/Reset Contents and Settings for simulator - run from XCode

Resources