I copied my project in a running state but the copied project doesn't work for me although the actual project is running fine. When I build my copied project it gives me the following error:
I have cleared the cache and the derived data but the build still fails.
Does anyone have an idea what might cause this issue? Thanks in advance.
If you are using CocoaPods, open yourProject.workspace instead of yourProject.xcodeproj.
If you're working with SPM, deleting the .build folder and re-running swift build solves the issue for me.
Did you try to remove the cache ?
rm -rf /Users/abdulrehman/Desktop/StudentMentor/DerivedData/ModuleCache/DLJPQMLQI1Q/
(I might have wrong copied your file path. So feel free to type it manually if there is nothing to remove at this path)
Goto your project folder
Delete the contents inside the DerivedDataXcode folder.
Clean the project
Run.
I had the same error, but the reason turned out to be having different iOS versions specified as Podfile's platform :ios and as my project's deployment target.
SwiftShims is a module defined in the standard library. It shouldn't be missing. I think it's because your DerivedData path changed, and now the compiler can't find its cache anymore.
I had the same issue...and after a lot of trial and error, the following worked for me..
Open your Xcode Workspace File -> Project_name(directory option on left) -> build settings -> Excluded Architectures -> Select 'Any iOS simulator SDK' and type arm64 in front of that ( for both build and release).
Repeat the same procedure for pods
Go to VS code and delete pod-lock and pod folder
open podfile and Paste the following code right above "target 'name-tvOS' do" in podfile.
post_install do |installer| flipper_post_install(installer) installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end end
(Note: some of the code body form above may already be there. In that case replace that part with this.)
Save it and run 'pod install' in your project's terminal.
go back to xcode and clear build (Cmd+Shift+K) and then build your project (Cmd+B)
Hopefully it will build without any issues.. Happy Coding!
You may get this error if you rename the project directory.
For your reference, I was using Flutter, so
flutter clean
It was solved with.
I have once encountered for a private local pod, which somehow Cocoapod set the lib product name as eg. "MyLib-6c4b1003" -- with a prefix in hex.
This random hex somehow changed, but the project Other Link Flags still using the old one. I did the search to find out the references to the old hex and deleted them, run pod install and the right name will be used.
I still cannot understand why there is this random hex in the prefix, but seems like Cocoapods setting up of the project could reference to the wrong one.
I had a similar issue when I wanted to remove Alamofire from Cocoapods.
then it needs to delete something:
target -- Build Settings -- Other Swift Flags
This junk of code worked for me.
It happened to me when I was running the release version and switched back to the Debug version with Product > Scheme > edit schemes.
Deleting derived data didn't help.
But simply doing Product > Clean Build Folder and restarting XCode fixed the issue.
In case you see this error in the preview canvas and the diagnostics "mtime changed":
'/var/folders/kv/t_w2wdds3m1_0lr02hcp3dgw0000gn/C/clang/ModuleCache/12TRQXIDQ8QQD/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
Delete all .pcm files in that folder and hit try again.
The folder on your machine will be different. Copy the location and run:
rm <paste path here>/*.pcm
You can delete your Derived Data from Terminal by this simple command:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Related
Xcode started throwing this error in a project today, and I'm having trouble figuring out what it means and how to troubleshoot it, and it's not coming up in any searches. It happens immediately after trying to build to a device (no scripts compile, etc):
error: Unable to load contents of file list: '/Users/.../Products/Debug-appletvos/myapp.app/Info.plist' (in target 'myapp')
Full log below, (note I've replaced build folder with ... for brevity)
Showing Recent Messages
Prepare build
note: Using new build systemnote: Planning buildnote: Constructing build description
Build system information
error: Unable to load contents of file list: '/Users/.../Products/Debug-appletvos/myapp.app/Info.plist' (in target 'myapp')
Build failed 3/5/19, 3:09 PM 0.2 seconds
Things I've tried so far:
Restarting Xcode
Restarting Computer
'Product' > 'Clean Build Folder'
Manually deleting everything in Build folder
Re-download repository on the same computer (same issue)
Re-download repository on a different computer (same issue)
reverting to a previous commit that was working (same issue)
plutil Info.plist responds with Info.plist: OK
Other items of note:
Project uses Cocoapods
Project utilizes custom C++ code
The only file list in the Info.plist file is a list of 2 custom fonts, but those are showing up ok in the Xcode project browser (not red).
If anyone has encountered this before and has a fix, or has any other suggestions for troubleshooting I would greatly appreciate it, thanks!
In my case, I just fixed below
Open terminal under project folder
pod deintegrate
sudo gem install cocoapods-clean
pod clean
Open the project and delete (if it's still there) the “Pods” folder that should be red
pod setup (This may take some time)
pod install
I fix this in this way:
1、Go to your project's target, -> Build Phases -> Embed Pods Frameworks
2、check the input files and input file lists, Output files, and output file lists.
3、move dir from input file lists to input files, and output file lists to output files
I realised after a while that my colleague has updated cocoapods to the latest version, so what I did was just
sudo gem install cocoapods
And that did the trick! :)
Finally figured this out, posting here so others googling can find it.
It was an issue with a build script that used the 'Input File Lists' option, removing and re-adding the script fixed the issue.
Nav to Target
'Build Phases' tab
'Run Script' phase
make notes of what's there, remove it
re-run to make sure things work
re-add the script (and content under 'Input File Lists')
The problem is that you have added path to Input File Lists instead of Input Files
In my case
pod deintegrate
pod install
was enough
In my case, I just fixed below
1- Go to your project's target, -> Build Phases -> Delete [CP] Copy Pods Resources.
2- pod deintegrate.
3- pod install.
First, you work:
Delete the .xcworkspace file
Delete the Podfile.lock file and Pods/ directory
Keep the Podfile
Rerun pod install
If the error still occurs, you need to add include .xcconfig path for CocoaPods in your .xcconfig files by prepending an #include statement like the following: #include “Pods/[path .xccofig file in Terminal”
Example:
I have two environments Stag and Production
After I run the pod file in Terminal. You’ll see in Terminal that CocoaPods did not set the configuration since we already set custom configurations. CocoaPods provides a link to be included in each
Open .xcworkspace file and select .xcconfig file
Finally, Cmd + Shift + K and run project
Good luck!!!
No need to deintegrate pods and install again. Just run
pod install
It will create necessary files for new configurations.
In my case, Xcode was using a Build Configuration that didn't exist anymore. Going to 'edit scheme...' and selecting a valid scheme fixed it for me.
In my case, the problem wasn't about cocoapods, it was about Fabric
I removed row $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) from Build Phases > Fabric > Input File Lists and it fixed the error
While compiling the application getting as following error
" compiled with older version of Swift language (3.0) than previous files (4.0) file "
Could you please help me?
Use the xcworkspace to build instead of the xcproject?
This usually happens when using Cocoapods and you are building from the xcproject which doesn't know about the cocoapod libraries.
Delete the derived data and do a clean build.
And if you are building a framework, make sure you've selected Generic IOS Device while building or set the Build for Active Architecture only as true in Build Settings.
I think this happens because you changed your app name or maybe the target
look to solve this problem see your target in Podfile
and then come back to your xcode in the targets
select your target app and in linked Frameworks and Libraries (the last one down) see if there's
any pods with light color and a strange name than your target in the podfile
and remove it using the minus button down .
I'd rather fix the specific problem, but if none of the other answers worked a full reset can solve it. If you are getting this error and you are also getting error readouts that refer to "duplicate symbol files", AND all other efforts have failed, then a full reset could work for you.
What worked for me:
Read the error report to identify the repo that supposedly contains duplicate files.
Drag repo to the trash.
re-clone your repo.
set up your repo with correct remote tracking. git remote add <url.git>, or git remote set-url <url.git>
This absolutely worked for me. In my case for some elusive reason, when I ran git pull upstream develop for a local dependency, git would pull in/generate duplicate files from multiple commits.
After following the above steps, the issue went away and git pull upstream develop was no longer pulling from multiple commits at once. Perhaps there was a weird git cache for my repo.
I had the two copies of files in the codebase. Deleting one copy helped code to build successfully
I am probably late for you, but for future devs in problems...
If you have been manipulating the podfile or creating new targets or maybe changing the name of any of them, check that in build phases options your just have correct pod framework for the name of the targets.
if you have pod
first clean project and close Xcode then open terminal and go to folder of Project then pod update
open the project and run
in my case work!
I fixed this problem today by running the app in the simulator using the target associated with the bundle file named in the Build Settings-->Bundle Loader setting of the test target. Previously I had deleted my derived data folder while working on a different target that has a different Product Name than the one associated with the test target bundle file. Rerunning the app in the simulator must have recreated the bundle file in the derived data folder that the test target is looking for and then my tests started running fine.
Somebody please save me.
This is the error I'm getting. I've tried cleaning, doing a build clean, pod installs and updates. I have not found a solution.
Shell Script Invocation Error Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/Anti-Social: No such file or directory
I have similar issues in the past and doing the following work for me. Hope your problem is same as mine:
Close xCode
Go to this folder Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/
and delete Anti-Social.
Restart xCode, clean & build.
It is hard to really tell you the solution with just the information provided. However, the first thing I would try is deleting the derived data, as CodeBender stated. You should also look at your search paths in your project's building settings to make sure your pods are correct/ connecting your pods files to your project.
Possible duplicate of:
Xcode 8 Shell Script Invocation Error
Here is what I did when I got this:
Used this site to completely remove All Versions of cocoapods:
https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
Re-installed current stable version of cocoapods (v1.1.1 for me)
Deleted podlock and pods directory
Deleted old .xcworkspace file (this was key for me).
Did "pod install"
Opened xcode and cleaned project and deleted derivedData.
Go to your build phases and remove libReact.a from the linked libraries.
Then add libReact.a but select this one:
libReact.a from 'React' target in 'Pods' project
I have just added Google Analytics to my pods like this:
pod 'Google/Analytics'
just like GA documentation suggests. Now my project won't link. It says:
library not found for -lGGLAnalytics
Did anyone ever encounter this? Thanks
I got the same error. Solved by reseting LIBRARY_SEARCH_PATHS to default value.
Select your target and navigate to Build Settings. Under Search Paths select Library Search Paths and reset it to default by pressing backspace.
In result, the value for Library Search Paths should change from blank:
to default:
Diff in .pbxproj just removes the empty value:
I'm using pods version0.39.0, Xcode 7.2.
In my case the solution was remove all but $(inherited) in Target -> Build Settings -> Other linker flags
Then of course clean and build!
I ran into this and had a very strange cause and different solution from the above, so I figured maybe this might help someone else who shows up here.
I had a working project in my normal directory and I save it to an SVN code repo. I needed to step back to a previous version for something, so I checked out a new copy from SVN and updated it back to the revision I needed.
Then I started getting the library not found for -lGGLAnalytics error.
It turns out that SVN doesn't really like it when you check-in *.a files and it ignores them by default. So my SVN repo had all of the Google Pod code but was missing the libGGLAnalytics.a files and a couple of other .a files.
How I solved it:
I copied the Pods/Google and Pods/GoogleAnalytics directories over from my real project. Then I did a pod install from the command line which updated my project files to reference those files that were previously missing.
I did a Build Clean and all fixed.
Having a problem when building with xcodebuild. My project/app builds fine with the Xcode - gui. It simply isn't finding/building the libcryptopp library which is part of the build process.
The error is:
clang: error: no such file or directory: '/Users/builder/repo/ioskpay/xcode-cryptopp/cryptopp/build/Release-iphoneos/libcryptopp.a'
This particular file should be derived from another project inside the main app - xcodebuild simply isn't correctly pointing at the right file folder which should be:
~/Library/Developer/Xcode/DerivedData
Any ideas?
To fix this, go to your project settings, go to Targets and select your main project target. Then go to Build phases. Under Target dependencies add the static library project.
This way, when you compile the main project, the static library subproject gets compiled before the main project and your static library will be available.
I had the same problem, but for a resource file .m
I opened target -> build phases -> Compile sources
and I found the file the compiler was tell it can't find duplicated: one with strange icon and the other with a normal icon. I simply removed the one with strange icon and it worked. ( I added the file multiple times and I had a merge conflict before that which made something wrong in the project file)
For your case I think you need to remove the lib from target dependencies list and add it again. This may work for you.
In Xcode Version 9.2 (9C40b) this happened when I drug a bunch of files into the project, some of which were duplicate. Rather than simply not adding the duplicates, it added them again and only the name, not the path.
In Target > Build Phases > Compile Sources each of the duplicates showed with no "...in" after them. Each one caused the clang error.
After removing all of the duplicates that Xcode collected, the project compiled and ran.
It makes you use the Project Navigator instead of managing your source files in the Finder. Then the Project Navigator can't replace duplicates like any decent file management system (ahem Finder). 🤨
My xCode info is:
I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:
clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
clang-4.0: error: cannot specify -o when generating multiple output files
others
Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.
Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:
as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered.
To fix this problem (in my case that I will not need anaconda any more): (edited)
1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner).
2.- Re-install xCode
After reinstalling xCode, if you type again clang --version, you'll get this:
More info at: https://github.com/flutter/flutter/issues/32457#issuecomment-496161092
Hopefully, this info helps some else.
Best
Ok so by simply adding the correct -target -configuration and -scheme parameters I got this to run correctly. However due to my running this in Jenkins for autobuild purposes it still doesn't work as I'd like - getting stuck in exactly the same place. It's odd because I have the exact same code being built in another job that isn't having this problem. There is no rhyme or reason for it at this point. I will keep shooting rubber bands at it and update when I have an answer...
Sometimes Xcode performs weird.
You have to find that static library project e.g.. "filename.a" under 'Link Binary With Libraries' in Build Phase and then remove it and add it again.
I had the same problem while I was archiving my target. I removed the library and the build succeeded.
For me it was because I had removed a package or pod. I ran pod install and it fixed it
Look for the missing file in the Xcode project i.e the files may be deleted or miss placed.
add the missing files to the xcode, then everything will work fine.
Run this command :
$ conda deactivate