Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 12.5 beta - Swift Compiler Error for RealmSwift module #7083

Closed
jkochcode opened this issue Feb 2, 2021 · 28 comments · Fixed by #7098
Closed

Xcode 12.5 beta - Swift Compiler Error for RealmSwift module #7083

jkochcode opened this issue Feb 2, 2021 · 28 comments · Fixed by #7098

Comments

@jkochcode
Copy link

jkochcode commented Feb 2, 2021

Goals

Build Realm on Xcode 12.5 beta

Expected Results

To be able to build project

Actual Results

Got a Swift Compiler Error for the RealmSwift module in Combine.swift
with the error being that 'Identifiable' is only available in iOS 13 or newer.

Steps for others to Reproduce

Add Realm and RealmSwift modules via SPM in Xcode 12.5 beta
Build project

Version of Realm and Tooling

Realm framework version: 10.5.1

Realm Object Server version: ?

Xcode version: 12.5 beta

iOS/OSX version: macOS 11.2

Dependency manager + version: SPM (also tried with same error with Cocoapods)

@jsflax
Copy link
Contributor

jsflax commented Feb 3, 2021

Hey, this issue seems legitimate. We'll get to it shortly.

@rubengarciam
Copy link

@jsflax any update?

@dejiapps
Copy link

dejiapps commented Feb 6, 2021

I am having the same issue.

@rittermobile
Copy link

Same issue here. When will this be fixed and available?

@randyhill
Copy link

I'm having this issue. XCode 12.5 Beta, application build. "Identifiable' is only available in application extensions for iOS 13 or newer" on on the following line in Combine.swift.

public protocol ObjectKeyIdentifiable: Identifiable, ObjectBase {
    /// The stable identity of the entity associated with `self`.
    var id: UInt64 { get }
}

@tgoyne
Copy link
Member

tgoyne commented Mar 15, 2021

This was fixed in 10.5.2.

@randyhill
Copy link

Thanks, I copied the Realm Cocoapods example too literally, didn't notice it was set to '=10.1.4'

@JulianKahnert
Copy link

From #7098:

@jsflax the problem still exists in v5.5.0 any chance to fix this in that version? Not sure if we can update from v5.5.0 to v10.x.x at this point.

I've fixed it in this fork.

Does anyone know if there is a fix planned for v5.5.0?

@tgoyne
Copy link
Member

tgoyne commented Mar 16, 2021

I've started assembling a v5.5.1 release that'll include this.

@JulianKahnert
Copy link

Awesome thx 🙏

@michaelguren
Copy link

I've started assembling a v5.5.1 release that'll include this.

Any update on v5.5.1?

@tgoyne
Copy link
Member

tgoyne commented Apr 28, 2021

It was released a month ago.

@michaelguren
Copy link

It was released a month ago.

Oh, thanks for the quick reply.

I didn't see v5.5.1 in the release notes and my cocoa pods weren't finding it using ~> '5.5.1'. I ended up using pod 'RealmSwift', '5.5.1' and it worked. Thanks again.

@JonyFang
Copy link

Xcode 12.5 binaries has been added to the release-v10.7.4 package. pod update Realm RealmSwift will work.

@mnkadafi
Copy link

mnkadafi commented May 9, 2021

Thanks

@yves8833
Copy link

I have a similar issue, when build Realm(10.10.0) on Xcode 13 BETA3, Xcode error shows 'AnyCancellable', 'Publisher', 'CAncellable' is only available in iOS 13.0 or newer, but the error only occurs on the device under iOS 12.
i'm not sure it is the same one or anything i did wrong

@dianaafanador3
Copy link
Contributor

Hi @yves8833 are you using Cocoapods or SPM to install Realm?

@yves8833
Copy link

Hi @dianaafanador3 i use cocoapods (v1.10.1)

@dianaafanador3
Copy link
Contributor

It's working fine on my part on Xcode 13 (Beta 4), Realm(v10.10.0) Cocoapods (v1.10.0), Device (Simulator iOS 11.4)
Can you update to the latest Xcode beta version?, maybe it is something they fixed between versions.

@yves8833
Copy link

Thanks i will try it.

@dianaafanador3
Copy link
Contributor

Hi @yves8833 there are some users having a similar error, seems like an Xcode issue, you can follow the thread here #7368

rcaos added a commit to rcaos/TVToday that referenced this issue Sep 23, 2021
@zohairhadi
Copy link

When I updated to Xcode 13.2.1, it started showing me Swift Compiler Error in RealmSwift/SwiftUI like

  • Cannot find type 'Binding' in scope
  • Unknown attribute 'StateObject'

Screenshot 2021-12-25 at 3 30 15 PM

@vicmosin
Copy link

@zohairhadi was you able to solve the issue?

@harry-lynn-evans
Copy link

@vicmosin @zohairhadi - I'm having the same issue. Any help here would be great.

@alissone
Copy link

It seems to work for me after changing the iOS Deployment Target of RealmSwift pod to 12.0 and do a pod upgrade.

@zohairhadi
Copy link

zohairhadi commented Jan 14, 2022

@alissone so what version did RealmSwift jump to? If it jumped to their latest version, they stated in their release that they fixed this issue. I suppose a simple pod update would work as well

Furthermore, what is support for iOS 11 is needed?

@vicmosin
Copy link

It seems like I fixed the issue by just bumping the RealmSwift to the latest version (~> 10.21) without adjusting deployment target explicitly.

@zohairhadi
Copy link

Yes, updated to 10.21 works now. Thanks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.