简体   繁体   中英

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 .

You should refactor your code to use __attribute__ instead of + (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.

A Fix was already made, let's hope it enters the react native 59.3. (Fingers Crossed.)

For more information: 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.

对于在使用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. Solved by updating all the library with version compatible to Xcode 10.2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM