简体   繁体   English

objc [29733]:Swift类的Swift类扩展和类别不允许在ios 12.2上运行+ load方法xcode 10.2

[英]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,请更新。

对于在使用Xcode 10.2的React Native项目中遇到此错误的任何人,请检查您是否使用版本0.59.3或更高版本的react-native ,其中包括针对此问题 的修复 ,这与使用RCT_EXTERN_MODULE用于Swift类有关。

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.

相关问题 Swift 类上的 Swift 类扩展和类别不允许有 +load 方法 - Swift class extensions and categories on Swift classes are not allowed to have +load methods 升级到iOS 12.2(Xcode 10.2)后,Swift 4.2中的奇数泛型和可选行为 - Odd Generics & Optional Behavior in Swift 4.2 after upgrading to iOS 12.2 (Xcode 10.2) 自定义类不会自动显示 - Swift 3 iOS 10.2 Xcode 8 - Custom class not automatically showing up - Swift 3 iOS 10.2 Xcode 8 Xcode 10.2 iOS Swift (+ React Native) 项目编译错误 - Xcode 10.2 iOS Swift (+ React Native) project compilation error 无法在新的Xcode 10.2(iOS 12.2)中构建Alamofire框架 - Unable to build Alamofire framework in new Xcode 10.2 (iOS 12.2) 我在Swift 10.2上运行自编码应用程序时遇到问题 - I have a problem on running my self coded app on Swift 10.2 Xcode,Swift,无法识别的单元测试类/方法 - Xcode, Swift, unrecognised unit test classes/methods Swift 扩展中的覆盖方法 - Overriding methods in Swift extensions didRegisterForRemoteNotificationsWithDeviceToken 没有被调用 Swift 5,Xcode 10.2 - didRegisterForRemoteNotificationsWithDeviceToken is not getting called Swift 5, Xcode 10.2 Xcode 10.2 上的 Swift 通用框架问题 - Swift Universal framework issue on Xcode 10.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM