there are some reasons that cause this error to be shown.
1- the project name is the same as a dependency that is used on the project
this error may happen when you choose a name for your project that is the same as one of the dependencies that you use on the project for example you cannot choose FirebaseAuth
or GoogleSignIn
as the project's name if you use them via pod or SPM.
to solve this problem you should change the project name with the following way:
choose the project from project navigator
on the left sidebar, change the project name from the file inspector
-> Identity and Type
-> name
from the right sidebar.
after you change it, XCode asks you to change all relative targets and just press rename.
2 - duplicated info.plist on the Copy Bundle resources portion
you may face this error when info.plist is added to Copy Bundle resources
unwanted, choose project form project navigator
-> choose target -> goto Build Phases
tab -> Copy Bundle Resources
and if you see info.plist there, remove it by choose info.plist like the following image
3 - pod files do not work well
sometimes you got this error because the dependencies that you use break for unexpected reasons.
1 - Delete Podfile.lock
2 - Delete Pods directory
3 - Delete Derived Data & Clean (you can find this directory from XCode
menu -> Preferences...
-> Locations
-> Derived Data
and go to the directory by clicking the arrow icon at the right of the address)
4 - Exit Xcode
5 - Update CocoaPods with [sudo] gem install cocoapods
on mac terminal
6 - goto the project directory on the terminal and run pod install
7 - Open workspace and build
5- duplicated Core data
you may face this problem when you use Core data on the project
first I explain coreData codegen types:
**Class Definition: ** Choose Class Definition when you don’t need to edit the properties or functionality of the managed object subclass and properties files that Core Data generates for you.
Category/Extension: Choose Category/Extension to add additional convenience methods or business logic inside your managed object subclass.
Manual/None: Choose Manual/None to edit the properties in your managed object subclass, for example, to alter access modifiers, and to add additional convenience methods or business logic.
Choose the Manual/None
and check if a copy of xcmodeldata is exist on CopyBundleRecources
, remove it.