warning: Swift error in module. Debug info from this module will be unavailable in the debugger

时光怂恿深爱的人放手 提交于 2019-12-06 20:17:05

问题


I have no debugging values in my console for my swift + obj-c app, and I get a really unhelpful message that explains why the debugger isn't working: "warning: Swift error in module XXX.". XXX is the name of my module, not a 3rd party that I include.

My app has been around before swift. I used the bridging header to start using swift, and I recently use the xcode tool to migrate all the swift 2 files to swift 3. (but I still have obj-c legacy in there). I use cocoa pods, which may be contributing to the problem.

(lldb) po self warning: Swift error in module XXX. Debug info from this module will be unavailable in the debugger.

I tried following the second answer to this post and a couple others I have found that suggest the same thing: remove duplicate imports.

I tried removing duplicate imports from my swift project. In fact if I run find . -name "*swift" | xargs grep "import" and I get no results. So I went to the extreme of removing all imports from all of my swift files (and commenting out code to get it to compile) just to see if I can get my debugger to come back.

So...

  • Is there another solution to this problem?
  • Is there a way to get a more detailed error message?
  • Is it a problem to have duplicate headers in the my bridging header? For example, a lot of my obj-c files import UIKit, and I include a few of those files in the bridging header.

回答1:


Just now I have encountered this problem. This is my solution:

If you import 3rd repo by Cocoapods, and the repo is written by Objective-C, you need to import it by this way:

// System 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

// Directly add - Objective-C
#import "EaseUI.h"

// Cocoapods - Objcetive-C
@import MJRefresh;

You can refer to this issue in Github and this question.



来源:https://stackoverflow.com/questions/44290557/warning-swift-error-in-module-debug-info-from-this-module-will-be-unavailable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!