试图在构建设备时使用前向类“EKCalendarItem”作为“EKEvent”的超类(Attempting to use the forward class 'EKCalendarItem

编程入门 行业动态 更新时间:2024-10-28 17:25:48
试图在构建设备时使用前向类“EKCalendarItem”作为“EKEvent”的超类(Attempting to use the forward class 'EKCalendarItem' as superclass of 'EKEvent' when building to device)

我有一个使用React Native和React Native Calendar Reminders本地模块的iOS项目。 当在Xcode和建设模拟器一切正常。 将其更改为“通用iOS设备”时,出现以下错误:

While building module 'EventKit' imported from .../RNCalendarReminders.m:3: In file included from <module-includes>:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EventKit.h:20: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EKEvent.h:37:22: error: attempting to use the forward class 'EKCalendarItem' as superclass of 'EKEvent' @interface EKEvent : EKCalendarItem { ~~~~~~~~~~~~~~~~~~ ^

RNCalendarReminders.m第3行是:

#import <EventKit/EventKit.h>

我证实了在Target的Build Phases中它与EventKit.framework库链接。

Xcode版本:8.2.1(8C1002)

I have an iOS project that uses React Native and the React Native Calendar Reminders native module. When in Xcode and building to the simulator everything works fine. When changing it to build to "Generic iOS Device" I get the following error:

While building module 'EventKit' imported from .../RNCalendarReminders.m:3: In file included from <module-includes>:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EventKit.h:20: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EKEvent.h:37:22: error: attempting to use the forward class 'EKCalendarItem' as superclass of 'EKEvent' @interface EKEvent : EKCalendarItem { ~~~~~~~~~~~~~~~~~~ ^

RNCalendarReminders.m line 3 is:

#import <EventKit/EventKit.h>

And I verified that in the Target's Build Phases it links with EventKit.framework library.

Xcode version: 8.2.1 (8C1002)

最满意答案

我自己解决了这个问题。 我不知道如何,但/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EKCalendarItem.h是一个空文件。 我在某些时候在Xcode中查看时可能会意外地将其清除。

我重新下载Xcode并解决了问题。

当在模拟器上构建时,这可以很好地工作,因为在这种情况下, EventKit.framework是从/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/EventKit.framework读取的二进制文件/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/EventKit.framework 。

I resolved this issue myself. I'm not sure how but /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/EventKit.framework/Headers/EKCalendarItem.h was an empty file. I may have accidentally cleared it out when looking at in Xcode at some point.

I re-downloaded Xcode and it resolved the issue.

The reason this worked fine when building on the simulator is because in that case EventKit.framework is a binary read from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/EventKit.framework.

更多推荐

本文发布于:2023-07-14 20:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1107181.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:前向   设备   EKEvent   EKCalendarItem   Attempting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!