Failed to remove "Info.plist" couldn't be removed - ios

I have been trying to fix this a few days before. I was adding JSQMessagesViewController to my iOS project. Added the library manually by dragging and dropping the JSQMessagesViewController folder downloaded from Github. tried to add a Bridging header for jsqmessagesviewcontroller. tried to add
#import JSQMessagesViewController
#import JSQMessages.h
later then when I build the project I found this error message
error: failed to remove /Users/user/Library/Developer/Xcode/DerivedData/CHATAPP-gcvyuyhkvbxvnlfnrrbmaebxevhx/Build/Products/Debug-iphonesimulator/CHATAPP.app/Info.plist: “Info.plist” couldn’t be removed.
I tried searching but didn't help any... what went wrong? How Can I remove this error ? using swift 2.2 and xcode 7.2

I began experiencing this issue right after making a pod install with Fabric (that made some changes to Info.plist). Then I realized that there was two Info.plist references in my project.
To solve the problem I just removed one of them, cleaned my project (Cmd + Shift + K) and built it again.
Hope this helps.

I fixed the similar issue by removing info.plist from BuildPhases-> Copy bundle resources -> "info.plist"
remove error specific .plist file from "Copy bundle resources" (in my case info.plist in MGSwipeTableCell creating issue)

you may need to add the files to your project. While in XCode right click on your files and select "add files to project" navigate to your project folder and select JSQMessagesViewController files then build.
You may also want to clean your derived data if you press Command Option Shift K then build the project again.

Removed those manually added files from my Project then made a fresh install using Pod now I don't have that error.

i recommend to you use pod to your project or drag and drop only require files from JSQMessagesViewController
you should don't import another project completely.
conclusion :
use pod for using JSQMessagesViewController because it has some dependency

Related

Xcode 8.0 Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

When I compile my code on Xcode Version 8.0 beta 4 (8S188o) I get this single error bringing the compilation to failure:
Command
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
failed with exit code 1
I tried to clean the project and wipe the derived folder but that did not change things.
What is it and how may I know more about it?
When I try to compile on the terminal the error being reported is:
Invalid bitcast\n %.asUnsubstituted = bitcast %swift.error* %13 to
i2, !dbg !438\nLLVM ERROR: Broken function found, compilation
aborted!\n
Happened to me, when I had two classes with the same name in my project. After deleting the redundant one, error disappeared.
If you look above the error, Xcode will tell you which ViewController is added/declared twice, navigate to it and remove the reference. Build and you're good to go.
I am going to tell you my silly mistake, the error is showing the issue and It took 3 hours to me to understand. look into below error
look into above 2 lines of error, the problem is shown, Obviously, In my case Xcode is complaining that Location.swift and Customer.swift file is missing, look into my project hierarchy, the same issue can understand.
It's my advice to everyone that first understand the error and then look into issues. I removed my desktop files, which were referenced in the project, and therefore compile error occurred.
Clean your project that fixed my project
Product/clean
I got this error for core data models that i've created manually.And it got resolved by changing particular entity's 'Codegen' attribute to 'Manual/None' under Data Model Inspector.
If you change any file folder location or change any Objective-C Bridging file path. Then it's happened some time.
Update your Bridging path.
Clean your project alt + Shift + Command + K
Quit Xcode completely Command + Q
Open project again and wait for Xcode to index files.
I got this error when I was trying to run an xcode project. A swift file wasn't being found and complied correctly, even though clearly in the xcode project file you can see the swift file and when you click on it in finder the file comes up as a separate xcode swift file. I solved this by:
Deleting the problematic swift file
Creating a new swift file with the same name
Xcode prompts that the file is already created, press replace
copy/replace the code/etc. in the file
Clean the project (for good measure)
Run the project
The problem went away by itself for mysterious reasons. Instead of the whimsical linking error I got a new bunch of errors due to Swift 3 fling which the app compiles and run fine.
The solution that worked for me is I had to delete the .xcdatamodeld file in my project and create a new one. This solved it.
I got this error and resolved by changing Xcode command line tools,
Goto Xcode -> Preferences -> Choose Locations tab
Choose required Command Line Tools from drop down, run the project error has been fixed.
In my case the error triggered when Xcode could not find a file/folder from the external Framework and dependency. In such a case just pod update / pod install do the job.
Try removing inactive file(deleted file) from Build phases...
Based on #Mohammed Rizwan N answer
If error not gone, do the clean project and close Xcode. Then click right button on .xcodeproj/.xcworkspace file and choose appropriate Xcode version.
In my case, I tried to run a project in Xcode9/Swift4, while the project was written on Xcode8/Swift3
1.Go to build settings and check the path of the info.plist file and bridging header file.
2.If not sure they are correct , from the left side drag and drop the files into respective fields .This creates the path automatically .
Clean the project and build again .
I created 3 new groups and put my MainVC under one of those groups. After I deleted one of the new groups I created, the error went away after I cleaned my project.
Please update your entire log which suggests the error, mine is telling me I have duplicated classes in file
Try closing Xcode, cleaning the project and building again.
At first, cleaning wasn't enough. I had to actually close it and try again.
I faced this issue when I resolved git conflict for the project file, which was for adding and removing some files.
What I found out is Xcode creates the folder named folder named "Recovered References", just search this from bottom left search option from Xcode and delete it. After you delete it you will only get an error for missing files. Resolve that by adding files again by right-clicking and selecting add files option. Once you are done with it project compiles with no error.
Happened to me when I found two swift files with the same name within the project, even if the classes have different names.
In my case error came when I moved my bridging-Header.h file from one folder to another. and when I checked in Build Settings -> Objective-C Bridging Header it was showing old path. Then I moved that file back to previous folder.
My problem was that my machine was running out of available space. Restarting it cleaned up ~8GB of temporary files, but I guess you can also delete something instead.
This is mainly because xcode is not getting the exact path of any file or duplication of file name under linking area.
In my case I have added bridge header file under Resources file and added the path in
BuildSettings->Objective-C bridge header-> bridgehearfilename.h
You should specify the exact path of that file in this section.
eg: BuildSettings->Objective-C bridge header-> Projectfolder/Resources/bridgehearfilename.h
Correct your file paths in the build settings then Clean and build the project.
For me it was ,
Product > alt + Clean Build Folder
OR
alt + Shift + Command + K
Do these 3 steps:
Clean Project: Shift+Command+K
Make sure low disk space shouldn't be on your mac
Focus on the upper lines of this error...Try reading them again...Paste those files that are missing or having some light icon in xcode project navigator and delete those files with light icon.
Hope you will fix the error.
I tried to run a project in Xcode12/Swift4, while the project was written on Xcode8/Swift3
so I install Xcode version 11.7 and run this work for me.

ERROR "swiftc failed with exit code 1" when converting to latest syntax

I was trying to convert syntax of old Swift project to new one as per few suggestion on Stack Overflow I tried converting it through Edit > Convert > To latest Syntax that did not work properly instead I started getting new errors shown as below
Command/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
failed with exit code 1
And
Command /usr/bin/ditto failed with exit code 1
I tried Xcode 6.0.1 Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1, but it's a different situation.
Have you tried to do clean with Clean build folder?
The combination keys is:
ALT + SHIFT + COMMAND + K
Try delete Derived Data folder and Build it.
Go to Xcode -> Preferences -> Locations for get the derived data path
Clean Xcode. (cmd+shift+k)
Quit Xcode completely.
Open project again.
Wait for Xcode to indexing files.
Now run your project.
Just had the same issue. For me it was because I had renamed some of the project directories. I had a ton of red files in my project navigator. To solve, follow these steps:
click on the directory in project navigator where many files show as red
Under "Identity and Type" in the File Inspector (on the right side), click Containing directory
Select the new directories
Rebuild - command shift K, command B
As far as I know there can be multiple reasons why a compiler fails. Although cmd+alt+shift+k will help most of the time. If this fails, then click on the error message and try to debug it.
For example in the image below, if you read the message, we get to know that, there has been a name duplication. Fixing the name duplication will fix the issue.
Just remove inactive file(deleted file) from Build phases
then
Clean Xcode. (cmd+shift+k)
delete Derived Data folder and Build it.
Go to Xcode -> Preferences -> Locations for get the derived data path or cmd+Alt+shift+k
OR
Just remove inactive file(deleted file) from Build phases
Cleaning the project wasn't working for me, this is because I didn't pay attention to the message right above (Xcode highlights only the final command).
In my case it was
<unknown>:0: error: filename "FileDuplicated.swift" used twice: '/../filepath/FileDuplicated.swift' and '/../filepath/FileDuplicated.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /../bin/swiftc failed with exit code 1
I had to change the name of one of the two files and it was solved.
Hope this can help someone, cheers
In my case it was due to the few swift files which has been showed grayed out in the Build Phases section. After removing those files it was successful.
In my case I deleted few files from project and when try to commit the code, the files was showing there . To solve this issue.
1. Open terminal
2. Type git clean -n // it will show you list of files which are deleted from project but still are saved somewhere
3. Type git clean -f // All unwanted files will be removed
In my case, it was "Other swift flags". I had declared a flag there but not -D, so this was not getting recognized and resulted in the same error
In my case swift development snapshot was selected instead of xcode 9.2. here are the steps and image.
xcode on screen and click on xcode top menu bar.
Than go to toolchains option and check on xcode 9.2. thats it.
Note: If no toolchain found in your xcode than download from Here and install it. (after installation restart xcode).
Happy Coding!!!
Ok, my turn now. In my case I had an existing project. I copied in a few files from another project. One of the files I brought in was SettingsViewController.swift and there was already a file by the same name I was not aware of. The files were in different directories of the project so no duplicate message was shown. The compile/link messages offered no clue to this. I figured out the issue by adding one file at a time to the project (there were 12 total) and the building each time until I found the offending file. I renamed the new file and project builds now.
In my case it was a compiler flag change that didn't work well. It took a few compiles before it actually started failing though! Xcode caches what it compiles.
I just had this issue. It's due to path references. Have you been moving files around and/or copying folders? Check if .xcodeproj is inside or outside of the main project folder. Also, make sure that the project's file and directory structure are intact.
/yourFolderProjectName/ <-- contains your .xcodeproj file AND folder with Xcode project name
/yourProjectFolder <-- here are .swift, info.plist, assets folder, etc.
/yourProjectXcodeFile.xcodeproj
Another thing to check:
In my case I had deleted a row in the "Other Swift Flags" section in the Build Settings screen under the Release setting.
That row had been a value for a compiler flag key/value pair. So the key was there but not the value.
Once I deleted the key as well, then the build worked again.
This issue is happening because of pods
So Follow the below steps to resolve this issue
Remove all the pods and re-install again.
Remove all the pods using below this command (rm -rf "pwd/Pods/")
Quit the Xcode and open it again and build the app with device (generic iOS device).
Now check this issue will be resolved.
I had this error when Xcode found two .swift files with same name. Rename one of them and build again.
Wait for completing the indexing and run the project again. You must get an error then check it which may be Objective-c bridging file not found error. This error comes if you are using any Objective-C library or code directly in the project and your project unable to find the bridging file in the system. This issue basically caused by, if project is unable to find any file in the system which is using in the project (path issue).
I faced this issue while using the Swift auto-generated header file in my project (named as 'TargetName'-swift.h) to use Swift classes in Objective-C.
There was a typo in the file where I had imported this swift header. Correcting the typo helped me resolve the issue.
Clean the build in Xcode cmd+shift+k.
Update the pods.
look the where errors showing.
Add the missing files in Xcode.
After Run the Code. Working fine.
Try below if none of the above working for you.
My project location was desktop/my_project_folder
I tried all above then i made simple change.
I create one more folder on desktop past my project
.
then...
Cause of problem in my case:
This problem occurred when i change my project name in xcode & project folder name from desktop.
I was working on a private pod and was also pointing to it locally. I had made some file name changes.
Hence I was getting this error.
All I had to do was to run pod install so it would reflect the file name changes. After that it compiled.
In my case I copied a core data entity and only renamed the entity but not the class.
So go to your xcdatamodel and select the enitity > rename also the class name
Had the same issue but with duplicate file references.
Deleting Derived Data and cleaning had no success. But I got it fixed by doing this:
Navigate to your project.pbxproj -> open with your text editor of choice(I use atom).
Command+F and find the duplicate file sources and then delete them.
Build/Run and should be fixed.
For me, it was the keychainAccess problem as described in this answer (my error messages were completely opaque, all I had to go by was 'failed with exit code 1')

Xcode doesn't recognize GoogleService-Info.plist file after adding Firebase via pods

I'm trying to add Firebase and I keep getting a log message thats says:
Could not locate configuration file: 'GoogleService-Info.plist'.
I added the file in Xcode by way of File > Add new file to project.
Any suggestions?
To anyone still having this issue:
Add the file to the project
Click on it:
On the right sidebar from Xcode, mark the Target Membership option:
I solved this by using these steps :
Go to Build Phases of your project
Expand "Copy Bundle Resources"
Click on Plus (+) button and add "GoogleService-Info.plist" file.
clean and build your project.
It happens to me. Just erase the (7). The Xcode firebase framework connects to firebase through the GoogleService-Info.plist when you build your code an error will be display if the .plist file is not called exactly: GoogleService-Info.plist. At the moment that the .plist file has another character in the name, the firebase framework will not recognize it. The framework is searching just for the GoogleService-Info.plist not GoogleService-Info.plist (07)
This usually happens when you download several times your GoogleService-Info.plist
from the console. If you want to avoid this. Get the file out from your "downloads" carpet. Otherwise, your computer is going to add a number at the end of the name file if you already have one inside that carpet. It creates a copy.
Hope this can help!
Change the plist name from GoogleService-Info(7).plist to GoogleService-Info.plist
This file should be in your project directory, not in pods directory.
I had the same problem. I solved the problem by following the steps below
Source: https://github.com/firebase/quickstart-ios/issues/5
Rename your file GoogleService-Info(7).plist to GoogleService-Info.plist.
My experience:
google-service.plist was on the gitignore and the Xcode holds a reference to it (if did exists) it SHOULD NOT BE IN RED COLOR. that means the actual file is missing just add them back in each folder manually ( not through Xcode).
Just Drag and drop GoogleService-Info.plist into xcode

'Framework not found' in Xcode

I know this has been asked a couple of times. I followed instructions from these ones:
Adding frameworks to project in Xcode 5 and having *relative* paths added
xcode4: Linker error: Directory not found for option
Still Xcode is giving this error:
Here's my current configuration:
The bolts framework is so I can use the Parse SDK. I downloaded the blank project from here: https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new
It's working. I tried to copy every config option, but it still doesn't work.
Try deleting Bolts.framework from linked framework and re-add it. Also, in your Framework Search Path keep path until Bolts.framework like $(PROJECT_DIR)/Bolts if it is inside Bolts folder at your project directory path.
I'm pretty new to iOS development. Apparently this problem for me was a result of opening the .xcodeproj Xcode project instead of the .xcworkspace Xcode workspace. I opened the workspace instead and the error has gone away.
error: Framework not found
If you use CocoaPods try to run:
pod deintegrate
pod update
Also use .xcworkspace instead of .xcodeproj
Delete the framework link from the Xcode project setting.
Move the framework to the Project Folder.
Re-add the framework in the Xcode project setting.
clean the project and re-compile it.
delete all frameworks from Embedded Binaries and re-add it
me too was getting this error , I moved the framework file to the root project folder and added to framework again and problem is solved.
1:- Delete the framework from the Xcode project. Quit the Xcode.
2:- Open your project in XCode and go to file under Menu and select Add files to "YourProjectName".
3:- Select "YourFramwork.framework" in the directory where you keep it.
4:- Click on the Copy items if needed checkbox.
5:- Click Add.
Make sure that you have the framework added in both Embedded Binaries and Linked Frameworks and Libraries under Target settings - General. As shown in the following images:-
Here is the solution :
Turn the "$(PROJECT_DIR)" attribute(might be non-recursive by default) into recursive option in Select Project Click on Targets Click - Build Settings Search for 'Framework Search Path' - Double click the input.
Scratched from https://stackoverflow.com/a/31298214/4493512
Besides from removing the framework from the Podfile and Linked Frameworks and Libraries, I also had to remove the reference to the framework in Other Linker Flags.
I just had the same situation (was having a hard time to address the OP's build error after adding a 3rd party framework) and it seems like a bug in Xcode (mine is 8.3.2 (8E2002)).
The problem was that a folder name in path to the framework contained spaces. In this case, Xcode incorrectly escaped them with backslashes like this in Build Settings -> Framework Search Paths:
$(PROJECT_DIR)/Folder\ with\ spaces/Lib
To fix this, just manually edit the entry to remove those backslashes and enclose the whole string in quotes like this:
"$(PROJECT_DIR)/Folder with spaces/Lib"
Delete the framework that is causing the issue (by removing the reference).
Then add it again, following these steps for adding FBSDK frameworks and libraries:
click project
general settings
linked framework and libraries
click the plus button and add all that you want
None of the above worked for me until I found that I had a blank "Any Architecture | Any SDK" line underneath Framework Search Paths / Debug under Build Settings.
Deleted the line and it works!
Error: Framework not found
If you use CocoaPods try to run these commands from terminal:
Intel chip:
pod deintegrate
pod update
Apple Silicon M1 chip:
pod deintegrate
arch -x86_64 pod update
Also use .xcworkspace instead of .xcodeproj
When this error occurred to me was because Pods folder was in iCloud and had no local copy on my computer. Go to your project's folder in Finder and check if there is iCloud's symbol in any of the folders inside it!
I realised that I hadn't run/built my framework with the Generic Device, which strangely lead to these issues. I just put the framework back in and it worked.
If you are using CocoaPods. Similar thing has happened to me. Although this question is old someone like me might still be struggling. So for to help:
after pod install it warns you about project files. I didn't notice till now. it says:
[!] Please close any current Xcode sessions and use
ProjectFile.xcworkspace for this project from now on.
So basically, do not continue working on .xcodeproj after installing Pods. If you do linker won't find files.
My framework has long name like FrameworkSDK_Light-1.0.6.framework so I renamed it to FrameworkSDK_Light.framework and it solved my problem.
I got the error 'AdBrixRM framework not found'. I checked the AdBrixRM.framework. I noticed that 'AdBrixRM' excution file is missed. I copied this file into the framework folder and the issue was gone.
I used to encounter this same exact issue in the past with Google Admob SDK. Most recently, this happened when trying to add Validic libraries. I tried the same old good trick this time around as well and it worked in a jiffy.
1) Remove the frameworks, if already added.
2) Locate the framework in Finder and Drag & Drop them directly into the Project Navigator pane under your project tree.
3) Build the project and Whooo!
Not sure what makes the difference, but adding the frameworks by the official way of going to the section "Linked Framework & Libraries" under project settings page (TARGET) and linking from there does not work for me. Hope this helps.
I found that the file.framework was referencing a file outside my project. So I dragged the file into my frameworks folder under my project and then got rid of the earlier file.framework file and it worked.
add github "BoltsFramework/Bolts-iOS" on your cartfile.
then carthage update.
after copy Bolts.framework from ../carthage/Build/iOS
Switching from iOS simulator to real device solved the problem for me.
Was facing the same error and solved it ---> Build Settings > Build Active Architecture Only = Yes
Please after adding both framework also open each Bolts and Parse framework and add Parse and Bolts to the project then problem will be solve
Running pod update in the root directory of the app fixed the issue for me.
If you are developing one module using cocoapods, try to comment the line
s.vendored_frameworks = "YOURMODULE.framework"
on YOURMODULE.podspec
The error will disappear after you generate and copy your YOURMODULE.framework to your project folder.
I had this issue on one of the project i worked, before you delete and readd the framework do a:
git status
on your project and check to see if the framework is not listed as deleted. In the event that it is either do a
git stash
or
git checkout *framework/file/path*

Xcode error with Cocoapod: "The document could not be saved. The file doesn’t exist"

I've added the SPGooglePlacesAutocomplete cocoapod to my project -- and I'm getting a really weird issue. When I try to run my project, Xcode says there's an error in one of the Pod's headers:
SPGooglePlacesAutocompleteQuery.h:65:23: Unknown type name 'CGFloat'
Attempting to adjust anything in that file - such as importing UIKit - results in an error: "The document SPGooglePlacesAutocompleteQuery.h could not be saved. The file doesn’t exist"
What could be making Xcode thing this file is non-existent?
For what it's worth, in my case the error came up when I was trying to edit a file pointed to by the warning/error pane in Xcode.
Not sure if that's cocoa pod related but I happen to be using pods also.
Basically you get an error, click on it and try to modify the file to fix the error and sometimes, not sure how, Xcode produces this error.
Since Xcode is stuck trying to save the changes to the file, you have to undo any changes you're made to the file in the error browser. Then editing the file by clicking on it in the regular browser instead of the warning/error pane will let you modify the file and save it.
I'm running Xcode 6.1.1 and Cocoapods 0.36.0.rc.1 and this happens when trying to modify a file from a pod added as a development pod (i.e. from a local directory).
I was facing this problem while I was developing objective-c pod and one of the file(say xx.h &.m) in Classes folder was giving this error prompt. I did following approach:
I copied xx(.h&.m) some where else (say Desktop)
Delete xx(.h&.m) completely from classes folder .
Force quit Xcode
Reopen the project
Drag the file xx(.h&.m) . Select 'copy item if needed' and 'target'.
problem solved!
I'm running Xcode 7.3 and CocoaPods 1.0.0. and this happens when trying to modify a file from a pod added as a development pod (i.e. from a local directory).
I just pod update again, when pod finished, Xcode will show an alert "The document has previously unsaved changes.", then click "Re-Save". that fix my issue.
I have face this issue many times. I followed below steps to fixed this.
Select file->Show in Finder
Copy the file and paste it in a different location.
Remove the original file from Xcode by selecting show in finder
Re-add the file that you copied from a destination and drag it into Xcode file pane where it was before.
Clean and run the code.
Delete derived data.
Force quit Xcode.
Open Xcode
Done
delete the generated pod folder, pod install again. solve my problem
For me what worked was restarting the Macbook.
I also had the same problem , it was when i was moving the file from one group to another . Xcode showed the same pop-up . All i did was copied all the content of the file with to a new file and deleted the old file , then quit and open the Xcode which solved the problem finally .

Resources