Skip to content

Rive view has a black background on macOS #451

@tbaranes

Description

@tbaranes

Submission checklist

  • I have confirmed the issue is present in the latest version of RiveRuntime
  • I have searched the documentation and forums and could not find an answer
  • I have searched existing issues and this is not a duplicate

Description

On the latest Rive version using the new Apple runtime, the animation has a black background on macOS. Using the legacy runtime, there's no issue with the same animation. Also iOS and tvOS doesn't have the issue.

Reproductible using the attached sample.

Rive Apple runtime version

6.20.6

Reproduction steps / code

Task {
    let worker = try await Worker()
    let file = try await File(source: .local("test", .main), worker: worker)
    let rive = try await Rive(file: file)
    let riveView = RiveUIView(rive: { rive }, isPaused: false)
    view.addSubview(riveView)
    
    riveView.translatesAutoresizingMaskIntoConstraints = false
    NSLayoutConstraint.activate([
        riveView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
        riveView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
        riveView.widthAnchor.constraint(equalToConstant: 200),
        riveView.heightAnchor.constraint(equalToConstant: 200)
    ])
}

Upload your reproduction files / stack trace

RiveBackground.zip

Screenshots / video

Screenshot 2026-06-12 at 21.41.25.png

Device

Mac Apple M1 Max

Apple OS version

26.5.1

Additional context

A dirty working workaround is to remove the set the MTKView's layer isOpaque to false after some delay:

repeat {
    try? await Task.sleep(for: .milliseconds(16))
} while riveView.superview == nil
riveView.subviews
    .compactMap { $0 as? MTKView }
    .forEach { $0.layer?.isOpaque = false }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions