[英]objc[29733]: Swift class extensions and categories on Swift classes are not allowed to have +load methods xcode 10.2 running on ios 12.2
我将我的Xcode更新到版本10.2(10E125),我现有的swift项目崩溃了“objc [29733]:在iPhoneX模拟器12.2中运行时,Swift类的扩展和类别不允许有+加载方法”
Apparently in iOS 12.2 you can't use anymore + (void) load
. 显然在iOS 12.2中你不能再使用
+ (void) load
。
You should refactor your code to use __attribute__
instead of + (void) load
. 您应该重构代码以使用
__attribute__
而不是+ (void) load
。
The old answer was given incorrectly but has good talk material to understand the problem. 旧的答案是错误的,但有很好的谈话材料来理解问题。
I ask to any Developer to give a better answer that this one. 我要求任何开发人员给出一个更好的答案。 I reckon my lack of knowledge is a speed bump on this answer but my idea is to at least start giving some insight on how to solve it!
我认为我缺乏知识是这个答案的速度提升,但我的想法是至少开始给出一些如何解决它的见解! If at least one developer can make is code work, my job here is done :)
如果至少有一个开发人员可以使代码工作,我的工作就完成了:)
===============================Old Answer================================== ===============================旧答案================= =================
It's a known bug. 这是一个已知的错误。 It seems the new 12.2 don't allow some method's to load swift modules.
似乎新的12.2不允许某些方法加载swift模块。
A Fix was already made, let's hope it enters the react native 59.3. 修复已经完成,让我们希望它进入反应本机59.3。 (Fingers Crossed.)
(手指交叉。)
For more information: https://github.com/facebook/react-native/issues/24139 有关更多信息,请访问: https : //github.com/facebook/react-native/issues/24139
There are some temporary work arounds pls check the link above. 有一些临时工作请检查上面的链接。
=============================EDIT old answer=============================== =============================编辑旧答案================== =============
react-native 59.3 was released a few moments ago with this bug fixed, pls update. react-native 59.3刚刚发布,修复了这个bug,请更新。
This issue was due to incompatible version of pod library for Xcode 10.2. 此问题是由于Xcode 10.2的pod库版本不兼容所致。 Solved by updating all the library with version compatible to Xcode 10.2.
通过使用与Xcode 10.2兼容的版本更新所有库来解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.