Realm + Xcode Playgrounds?

Since Xcode 12 playgrounds can now import Swift packages I thought that it would open some possibilities for Realm. First use case I wanted to test is creating a database (to bundle with my other project) inside of Playground. Here is what I’ve done to see If I could even use Realm from Playground:

  1. Created new Xcode storyboard project.

  2. Added Playground at projects root level.

  3. Added Realm with Swift Dependency Manager.

  4. Added this code to the Playground:

    import UIKit
    import RealmSwift


  5. Built project.

  6. Tried to run Playground.

What I’m gettin is those errors:
Error 1:
error: MyPlayground.playground:4:7: error: cannot find 'Realm' in scope print(Realm.Configuration.defaultConfiguration.fileURL!)

Error 2 (I think it’s not critical?)
Swift package target 'Realm' is linked as a static library by 'RealmPlayground124' and 'RealmSwift'. This will result in duplication of library code.

The steps I tried are based on this article.

Did I do something wrong? Is that issue happening on my machine only or is it replicable? Is this an issue with Xcode or Realm? (I’ve tried exact same thing with SwiftyJSON and it worked in Playground)

(Tried this both on Xcode 12.4 and 12.5 beta with Realm 10.5.2)

We got a similar issue reported The team is looking into it. Please follow the issue on GitHub to get updates.