skiptools / skiptools/skip-firebase

SkipFirebaseCore.swift: 'Date' does not appear to be a bridged type (Timestamp.init(date:))

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
18
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Summary

Building SkipFirebaseCore for Android fails during transpilation with:

error: 'Date' does not appear to be a bridged type

reported three times, pointing at the Timestamp class's initializers/methods that take or return Date:

public init(date: Date) {
    self.timestamp = com.google.firebase.Timestamp(date.kotlin())
}

and the two nearby members handling dateValue()/toDate().

Environment

  • skip: 1.9.8
  • skip-firebase: reproduced identically on both 0.16.0 and 0.20.3
  • firebase-ios-sdk: 12.18.0 (also reproduced independently while resolving against a fresh Package.resolved, so not tied to one exact BOM)
  • Host: macOS, Swift 6.1 tools

SkipFirebaseCore's Skip/skip.yml has mode: 'transpiled' and bridging: true.

Reproduction

Minimal Package.swift:

// swift-tools-version: 6.1
import PackageDescription

let package = Package(
    name: "repro-app",
    platforms: [.iOS(.v17), .macOS(.v14)],
    products: [
        .library(name: "ReproApp", type: .dynamic, targets: ["ReproApp"]),
    ],
    dependencies: [
        .package(url: "https://github.com/skiptools/skip.git", from: "1.9.7"),
        .package(url: "https://github.com/skiptools/skip-fuse-ui.git", from: "1.0.0"),
        .package(url: "https://github.com/skiptools/skip-firebase.git", "0.9.0"..<"2.0.0"),
    ],
    targets: [
        .target(name: "ReproApp", dependencies: [
            .product(name: "SkipFuseUI", package: "skip-fuse-ui"),
            .product(name: "SkipFirebaseCore", package: "skip-firebase"),
        ], plugins: [.plugin(name: "skipstone", package: "skip")]),
    ]
)

Any Swift file in ReproApp that does import SkipFirebaseCore (or import FirebaseCore on Darwin) is enough — the failure happens compiling SkipFirebaseCore itself, before any of ReproApp's own code runs. swift build reports:

.build/checkouts/skip-firebase/Sources/SkipFirebaseCore/SkipFirebaseCore.swift:156:5: error: 'Date' does not appear to be a bridged type
.build/checkouts/skip-firebase/Sources/SkipFirebaseCore/SkipFirebaseCore.swift:181:5: error: 'Date' does not appear to be a bridged type
.build/checkouts/skip-firebase/Sources/SkipFirebaseCore/SkipFirebaseCore.swift:185:5: error: 'Date' does not appear to be a bridged type

(Line numbers shift slightly between skip-firebase versions but land on the same three Timestamp members in both 0.16.0 and 0.20.3.)

Notes

  • Per the bridging reference, Date "should normally be bridgeable" and translates to java.util.Date in kotlincompat mode, so this looks like a regression or an edge case specific to how Timestamp uses it (a class-level KotlinConverting<com.google.firebase.Timestamp> conformance combined with a Date-typed public initializer/return value), not a fundamentally unsupported type.
  • I wasn't able to find an existing issue for this exact message/type combination — apologies in advance if it's a duplicate of something already tracked.
  • Happy to provide more of the surrounding project (a Skip Fuse app consuming SkipFirebaseCore directly) if useful.

Thanks for skip-firebase — the rest of the Auth/Firestore surface worked well for us in an earlier spike (via a throwaway skip init --native-app scaffold), this is the first real blocker we've hit wiring it into a production app shell.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Sources/SkipFirebaseCore/SkipFirebaseCore.swift and the Timestamp initializer plus its nearby dateValue()/toDate() members. Reproduce the failure with the provided Package.swift and swift build, then inspect how Skip transpilation handles Date in this class. Done means SkipFirebaseCore transpiles successfully for the stated Android setup without the bridged-type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, kotlin, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.