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

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.

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 ;).

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!

Sqlite database/file no longer in ios app build

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.

xcode build error: swiftc failed with exit code 1

Every time I tried to build the code getting the following error:
error log screenshot
To create build always need to quit the xcode or clean the project for many times.
Looking for a permanent solution.
You can try it by deleting derived data from Xcode -> Preferences -> Locations -> Derived data
Then clean the project and run.
I just had this issue and its due to path references. You cannot move folders or files in or out of the Xcode project once it’s built. . xcodeproj file should stay outside of the project folder. If you're moving files around or copying folders, check .xcodeproj outside of the main project folder and verify that the folder and file structure is still intact.

Xcode build process stuck at "Copying swiftdocs"

Creating a build for my Xcode project takes too much time. It gets stuck at "Copying swiftdocs". I am making a build to run on device. I cant understand why this is happening. No relevant info available on internet. Just for the info, I am using Cocoa Pods in the project.
Is it anywhere related to pods? I am unable to run the app on device.
Xcode stuck indexing error (compiling model, copying swiftdocs, etc.)
Open your Project Folder.
Find ProjectName.xcodeproj file.
Right-Click Copy and Paste to Safe Place.
Right-Click Show Package Contents.
Find project.xcworkspace file and delete that file.
Reopen Your Project and clean and Rebuild.
If your problem is not solved then replace the file with your backup file.
Hope this will work for you. If still not restart your mac some time it works with restart.

Resources