Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to print object ('po') in xcode6 beta 6 osx swift project: (Error in auto-import: failed to get module '__ObjC' from AST context)

An attempt to print object (po command) in xcode 6 beta 6 OSX Swift project results in this error message:

(lldb) po managedObject
error: Error in auto-import:
failed to get module '__ObjC' from AST context

In this case the object in question is an instance of NSManagedObject.

Any advice on how to help auto-import in getting __ObjC module into LLVM Abstract Syntax Tree context?

like image 525
Maxim Volgin Avatar asked Aug 27 '14 06:08

Maxim Volgin


3 Answers

As of Xcode 6.1 if you attempt the po command twice it will work on the second attempt. The first po command will always fail for each new debugging session but subsequent calls work.

like image 57
Robert Wagstaff Avatar answered Nov 18 '22 18:11

Robert Wagstaff


Have same issue in xcode 7.3.1:

error: Error in auto-import:
failed to get module 'Touch' from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h:17:10: error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
         ^
could not build Objective-C module 'LibXML2'

But you can use fr v managedObject instead of po managedObject.

like image 33
Alexander Danilov Avatar answered Nov 18 '22 19:11

Alexander Danilov


I'd recommend double-checking that you have the

-D DEBUG

flag set under 'Other Swift Flags' for the scheme that you're using to debug. I experienced similar issues when I'd accidentally deleted it.

like image 3
gemmakbarlow Avatar answered Nov 18 '22 18:11

gemmakbarlow