In Xcode 8, When any break point is hit, and I try to print any object in the Xcode debugger, it always prints "Could not resolve type". I have searched enough on the internet. I have checked if EditScheme->Run->Info->BuildConfiguration is set to 'Debug'. Build setting->Optimisation level is set to 'None'. But no clues on why this happens. Could anyone help me out here? Thanks in advance.
-
Is this an old-ish project? – shallowThought Dec 08 '16 at 15:59
-
No. This project is created using Xcode8 – CrazyDeveloper Dec 09 '16 at 06:18
-
@CrazyDeveloper did you solve this issue? – Reinier Melian Jan 18 '17 at 18:41
-
@ Reiner Melian No not yet. Still I have this issue. – CrazyDeveloper Jan 23 '17 at 05:11
-
refer this ['Could not solve type' - resolved](https://stackoverflow.com/a/45058945/4960875) You may find your solution. – hpDev_iOS May 17 '18 at 14:55
3 Answers
I encountered a similar issue with a pure swift framework that doesn't have any bridging headers but non the less had SWIFT_INSTALL_OBJC_HEADER
set to YES
It is described in more detail at https://stackoverflow.com/a/51186560/385307
After changing the setting to NO
debugging works again.

- 2,442
- 3
- 20
- 22
I had a similar issue with a Swift project which included an Obj-C framework. I had imported the framework in my Swift project using
import Obj-C-Framework
Additionally, I had also created a Bridging-Header file in the Swift project and included the Obj-C-Framework header using
#include <Obj-C-Framework/Obj-C-Framework.h>
This was causing the Xcode debugger to always show 'could not resolve type' when printing objects in breakpoints. Removing the #include in the Bridging-Header fixed the issue and objects print correctly in breakpoints.
TL;DR If your swift project uses an Obj-C framework make sure that the framework headers are not included in your Swift project's bridging header.

- 521
- 2
- 9
I just had the same problem and it had been solved.My project is a Mixed project with both OC and Swift. I found that some .h file import in my Bridging Header file that caused the problem. Definitely, an enum declared in the .h file cause the problem, like this:
typedef NS_ENUM(NSInteger,BadgeAlignment) {
AlignmentCenter,
AlignmentLeft,
AlignmentRight,
};
If i comment the code, everything goes alright.
And I just add a prefix to each element of the enum and the problem is solved for me.
typedef NS_ENUM(NSInteger,BadgeAlignment) {
BadgeAlignmentCenter,
BadgeAlignmentLeft,
BadgeAlignmentRight,
};
I just thinking if there is a conflict with some enum in Swift when convert the .h to Swift.
I'm still confused...

- 31
- 3