admin管理员组文章数量:1122832
I'm trying to run my iOS app on Mac via the "Designed for iPad" destination. It crashes on launch with this:
Failed to look up symbolic reference at 0x1006ac9bd - offset 162835 - symbol symbolic _____y_____GSg 11ActivityKit0A0C 19MyAppPlayerAttributesV in /private/var/folders/4d/wbdrh95d1pz_f5y659dt22gr0000gn/X/6723F443-F2B3-5BE2-99A0-82DA9EF5CB24/d/Wrapper/MyApp.app/MyApphere
This is because ActivityKit isn't available on Mac. However, even if I try to selectively exclude importing ActivityKit I still get the same crash.
//#if os(iOS) || os(watchOS)
#if canImport(ActivityKit)
import ActivityKit
#endif
Also, every part of the code that references ActivityKit is wrapped in a conditional check e.g.:
#if canImport(ActivityKit)
func startLiveActivity() {
guard ActivityAuthorizationInfo().areActivitiesEnabled else { return }
let attributes = AudioPlayerAttributes(audioTitle: memoTitle, startDate: Date())
let initialContentState = AudioPlayerAttributes.ContentState(isPlaying: isPlaying, currentTime: currentTime, duration: duration)
let content = ActivityContent(state: initialContentState, staleDate: nil)
do {
activity = try Activity.request(attributes: attributes, content: content, pushType: nil)
print("*** audioPlayer Live Activity started")
} catch (let error) {
print("***
本文标签:
iosMac Designed for iPad quotFailed to look up symbolic referencequot ActivityKitStack Overflow
版权声明:本文标题:ios - Mac Designed for iPad "Failed to look up symbolic reference" ActivityKit - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1736308358a1933633.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论