I tried adding XMPP framework into my ios project and I couldn't get it working. Turns out I added it incorrectly, So I tried removing it and now without XMPP I am getting these errors: Thanks in Advance!
This could also happen because of CocoaPods
. I had this issue with version cocoapods-0.39.0
, downgrading to cocoapods-0.38.2
fixed it for now.
You have two copies of AFNetworking in your project. Delete one of them.
...or better yet, use CocoaPods to integrate AFNetworking and your XMPP framework into your project.
I got this error after I refactored class from Obj-c to Swift and although classes names was different but methods names stay the same, so that was causing "Property Has a Previous Declaration" error. But it was only when I try to run app on different target.
So I just remove refactored class from project and clean the project, that solve the problem for me.
One of the reason for this is you are having duplicate .h or .m files.
A temporary workaround is to just select your project in Xcode, right-click and hit "Show in Finder".
Search for the file that is giving you error.
You will find two files of that name.
Simply delete one and you are good to go.
I had the same problem when I copied and paste whole XCode project to another location and opened it there. Probably has something with project settings and default paths for classes. Try making a new project and copying and pasting each class individually into the new project, created properly.
the error is your interface Duplicate interface definition for class. this is work for me duplicate interface declaration for class. somehow you have managed to import the .h file twice. Check to make sure you always use #import and not #include.
I don't think this will answer your specific problem, but for other people who got here via Google, in my case the problem was caused by a name collision of embedded class in a custom framework. Example of code that will result in such error:
public class Car: NSObject {
public class Wheel: NSObject {
}
}
public class Truck: NSObject {
public class Wheel: NSObject {
// "Wheel" class is duplicated and even though it's embedded in another class,
// it will still result in a collision in a ".h" file
}
}
I'm not actually sure if inheriting from NSObject
changes anything here.
© 2022 - 2024 — McMap. All rights reserved.