xcode 错误:无法 IRGen 表达,没有额外的错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52420272/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error: Couldn't IRGen expression, no additional error
提问by Pawe? Zemsta
I can not print debug information in my UI TESTS. Configuration: Xcode 10 and SWIFT 4.2.
我无法在我的 UI 测试中打印调试信息。配置:Xcode 10 和 SWIFT 4.2。
When I try to print something in console I can only see an error:
当我尝试在控制台中打印某些内容时,我只能看到一个错误:
"error: Couldn't IRGen expression, no additional error"
I didn't have any problem in earlier versions of Xcode (8,9 etc), only in Xcode 10. I can not print anything, when I put breakpoint and try to print for example app po XCUIApplication()
or something like that.
我在 Xcode 的早期版本(8,9 等)中没有任何问题,只有在 Xcode 10 中。当我放置断点并尝试打印例如应用程序po XCUIApplication()
或类似的东西时,我无法打印任何内容。
In the earlier version of Xcode when I write in console:
在早期版本的 Xcode 中,当我在控制台中编写时:
"po XCUIApplication.debugDescription()"
I saw the structure of my application.
"po XCUIApplication.debugDescription()"
我看到了我的应用程序的结构。
We found that the problem appears when an external framework is added to the UI Tests Target. We've created an example project with RxSwift.frameworkincluded which can be use to reproduce our issue:
我们发现在 UI Tests Target 中添加外部框架时会出现这个问题。我们创建了一个包含RxSwift.framework的示例项目,可用于重现我们的问题:
https://drive.google.com/file/d/1BlByFVNaOdDqT4ED9Jwyi1kJ99PTRQen/view?usp=sharing
https://drive.google.com/file/d/1BlByFVNaOdDqT4ED9Jwyi1kJ99PTRQen/view?usp=sharing
Regards.
问候。
回答by MichaelV
I had same issue with Carthage. However while looking more closely at console I've spotted that Carthage instead of building RxSwift just downloaded pre-built binaries,
我对迦太基有同样的问题。然而,在更仔细地查看控制台时,我发现 Carthage 而不是构建 RxSwift 只是下载了预构建的二进制文件,
*** Downloading RxSwift.framework binary at "Zürich"
that in turn contribute to IRGen error. So forcing Carthage to build framework instead of downloading binary worked.
这反过来又会导致 IRGen 错误。因此,强制 Carthage 构建框架而不是下载二进制文件是有效的。
carthage update --platform iOS --no-use-binaries
回答by Jim Ingham
The swift debugging format is a binary dump of Swift internal objects so you have to have compiled your binaries with the compiler that ships with the debugger you are using or things go badly.
swift 调试格式是 Swift 内部对象的二进制转储,因此您必须使用您正在使用的调试器附带的编译器编译二进制文件,否则事情会很糟糕。
I can repro the behavior you were seeing using Xcode 10.0 and the project you provided. But then I got the RxSwift sources from github and rebuilt them with the Xcode 10.0 compiler and replaced your RxSwift.framework with the one I built locally and reran the test, and the expression you had attached to the breakpoint worked correctly. Can you see if that also works for you?
我可以重现您在使用 Xcode 10.0 和您提供的项目时看到的行为。但后来我从 github 获得了 RxSwift 源代码并使用 Xcode 10.0 编译器重建它们,并将您的 RxSwift.framework 替换为我在本地构建的框架并重新运行测试,并且您附加到断点的表达式正常工作。你能看看这是否也适合你吗?
The debugger should have given a better error message, if you want to file a bug with the swift bug reporter (http://bugs.swift.org) we can look at improving the error message.
调试器应该给出更好的错误消息,如果您想向 swift 错误报告器 ( http://bugs.swift.org)提交错误,我们可以查看改进错误消息。
回答by Arijan
I had the same issue with Carthage - RxSwift.
我在 Carthage - RxSwift 上遇到了同样的问题。
Deleting files from
从中删除文件
Carthage/Build/...
迦太基/建造/...
Carthage/Checkouts/
迦太基/结帐/
And calling carthage updatein terminal resolved my issue.
并在终端中调用carthage update解决了我的问题。
Update:
更新:
We noticed this issue happens only when updating RxSwift library to version 4.3 and above. Setting version to 4.2.x works normal.
我们注意到只有在将 RxSwift 库更新到 4.3 及更高版本时才会发生此问题。将版本设置为 4.2.x 工作正常。
回答by Pet
Check if the frameworks are properly connected. In my case, the replacement framework on POD solved this problem.
检查框架是否正确连接。就我而言,POD 上的替换框架解决了这个问题。