No such file or directory but file exists Xcode - ios

I have audio files in my app.
I can listen to any of them but I can't run the app. Xcode writes " No such file or directory".
Here are the error and file paths.
I have tried to delete Xcode/Derived Data, but it doesn't work and in Copy Bundle Resources there are not red files.

iOS apps can access resources which are bundled into its Bundle during archive or the one that exists within its SandBox (resources downloaded programmatically and kept in document/temp folder of sandBox). Your audio files are on Desktop of your Mac and iOS app cant access them.
What should I do?
Select the entry of these items in your Xcode, delete them (remove only reference not original file)
now go back to desktop, select items and drag it to your project and select copy items if needed while copying
this will copy items to your app bundle now you can access it :)
Free of cost Advice
Thats a horrible coding approach to copy audio files (Assuming audio files are huge in size as I don't have context of your audio file sizes) to your app bundle :| this will bulk up your app size, think of more scalable approach, like downloading it on the fly from servers (lazy download, background download, or if you are streaming the m3U8 format etc etc)

Related

iOS: Include the resource(audio) files into the application folder of the app rather than adding into the bundle

Currently my resource(audio) files is included in the bundle. Due to this user is unable to delete the unwanted audio files to save the disk space on his phone. Please let me know how can I directly include the audio files into the Applications folder of app while submitting the build to AppStore and not in the bundle. Thereby user can delete the files which are not of his interest and re-download from the cloud backup hosted on S3 if needed.
The only way to accomplish this is to NOT have the audio files included in the initial app install.
Instead, your app could download the audio files from a hosting service... either download them all on first launch, or download each file as-needed.
You would then store the files on the device so they don't need to be downloaded again... and you could provide a UI to delete files the user no longer wants stored locally.

Finding application icons within an iTunes iOS backup

Is it possible to extract an iOS application's icon from its files within a locally stored iTunes iOS backup? I've searched the backup manifest and app related files and can find the list of installed apps, but no icons. Currently I am using the domain name as an input to the Apple iTunes search API.
e.g.:
for "com.facebook.Messenger"
https://itunes.apple.com/search?term=Messenger&entity=software
Ideal would be to extract from the backup files directly.
I remember at the time of 16 years, the time can also access to the application of through itunes. The ipa file and then through the ipa file modification extension into the. Zip file, directly open the can get the current English local resources, and then from the Payload folder to find the app file, right-click the display file content, can be read into the application of more local resources, basic inside it will include the app icon resources and Assets inside pictures, and so on
Unfortunately, I also forgot that the specific time was 17 years ago. This function was cancelled by an update of Itunes. However, we can still get the.ipa file package of the App with the help of three party tools in MAC, such as PP assistant and iToos. Then the relevant local resources of the application can be obtained through the method I just described
l hope help you

iOS App's Documents directory contents lost after Restore from Backup

I am working on an App that requires a folder structure in the Documents directory to access images and videos in various modules. These are stored there using a download process and it works fine.
While testing I restored the app using iTunes. I found that none of the downloaded assets where visible. After some searching I used the Download Container option in the Devices window of Xcode to view the package contents of my App.I found that all files that where stored in the documents directory were present, but none of the folders were present. I think this is what causes the issue.
I tried another similar project, but the folder structure was intact.

upload file to folder on device, filesharing ios

im using filesharing in my app, working fine, but I want now for organization to be able to upload files from itunes to app folder
the itunes lets me import a file "Add", but i cannot drag the file to the created folder in my file system or "Add" in my folder,
so how can i upload the images to the specified folder in the device?
or do I have to dynamically check for the content of the /documents/ content and move the file to the wanted folder??
thanks
You can only add files via iTunes to the documents directory. You can either create your own AFP or WebDAV server on the iPhone and connect to it like a network drive (you have to code the server yourself). Alternatively you can check for new items in the documents directory as you suggested yourself and move them to wherever you want. Bear in mind that if you move them from the documents directory you will not be able to access them through iTunes once moved. Why don't you just store them in the documents directory anyway?

Releasing IOS app with files in Library directory

I have an app that is going to display a list of local video files. The app will only have a couple of video files at first, but that number will grow with future updates and in-app purchases. I would like to store all these videos in 1 place and it makes sense to put them in the app's Library directory so they are not user-accessible. Is it possible to publish an app with files already in the app's Library directory? Or do I have to put them in the app's bundle and then copy them to the Library directory when the app is first launched? Although that would result in the 2 videos files being duplicated since I can't remove them from the bundle.
Yes, you do need to copy the files from the app bundle into the Library if you want to treat all the videos in the same way. You cannot change the contents of the app bundle from inside your app and the only files your app has when it first launches are those that are in the app bundle.
If you really wanted (and if the video files don't change), you could make special cases in your code to be able to get the starting videos from the app bundle and the in-app purchase downloaded videos from the Library directory. But, unless the video files are quite large this seems a bit excessive.
A third option would be to have the user download the starter files on first app launch, but that may be suboptimal for other reasons.
Please look at my answer in this thread. It might concern you or at least be interesting to read.
Does updating iOS apps delete library directory files?

Resources