1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Xcode15でRxRealmのビルドが通らない問題に対しての暫定的な対応

Last updated at Posted at 2023-10-26

概要

RxRealmを導入しているプロジェクトをXcode15でビルドするための暫定的な対応を行なった。
注意としてはあくまでただ単にビルドを通したいという暫定的な対応のためバグの発生など起こる可能性があるということである。

何が起きたか

Xcode14でビルドされている約1年前のプロジェクトをXcode15でビルドしようとしたときにエラーが発生する。

/Pods/RxRealm/Sources/RxRealm/RxRealm.swift:269:52 Cannot convert return expression of type 'Observable<Element>' to return type 'Observable<(Realm, Realm.Notification)>'
/Pods/RxRealm/Sources/RxRealm/RxRealm.swift:554:29 Cannot convert value of type 'PropertyChange' to expected argument type 'Element'

こういったようなエラーが複数出てしまいビルドすることができない。

しかも
https://github.com/RxSwiftCommunity/RxRealm
RxRealmは2023年10月現在では、version5.0.5で2022年9月に更新を最後に更新が止まってしまっている。

対応方法

さまざまgithubのissueなどを辿ってみるとどうやらこのプロジェクトをフォークして対応してくれているリボジトリを発見したのでそちらを利用するようにしてみる

Podfileの内容を書き換える

  pod 'RxRealm', :git => 'https://github.com/wilico/RxRealm.git', :branch => 'bugfix/xcode15'

これでpod updateでビルドが通るようになる

どういった変更内容になっているかコミットログを見てみるとさまざま変更はあるものの、ほぼ
Observable -> RxSwift.Observable
の変更のみであった
Observableという名前がコンフリクトをしてしまっていたという問題のようであった

https://github.com/wilico/RxRealm/pull/1
こちらのプルリクエストメッセージにある通り、いずれ本家で対応が完了した時点でこのリポジトリは削除されてしまうので、本家の対応が終わったらすぐに戻さないといけない。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?