Environment
- PowerSync Swift SDK: v1.13.0
- tvOS: 18.x (Apple TV 4K)
- Xcode: 16.x
- Device: Apple TV 4K (physical device, not simulator)
Description
PowerSyncDatabase(schema:dbFilename:) throws PowerSyncException: Could not open database ... with 6 on tvOS. The same code works fine on iOS and iPadOS.
Error 6 is SQLITE_CANTOPEN.
Full error
🔴 PowerSyncException: Could not open database
/var/mobile/Containers/Data/Application//Library/Application
Support/databases/tv.db with 6
Reproduction
let db = PowerSyncDatabase(schema: mySchema, dbFilename: "tv.db")
What I've tried
- Manually creating the Application Support/databases/ directory before calling
PowerSyncDatabase() — same error
- Setting FileProtectionType.none on the directory — same error
- Using a custom filename instead of the default powersync.db — same error
The directory exists and is writable (verified with FileManager.createDirectory), but the
Kotlin native SQLite layer still fails to open the file.
Suspected cause
openKotlinDBDefault() in KotlinPowerSyncDatabaseImpl.swift calls into the Kotlin/Native
PowerSyncDatabase factory. The Kotlin native SQLite binary may have a tvOS-specific issue
with file path handling or the powersync-sqlite-core.xcframework tvOS slice.
The powersync-sqlite-core.xcframework does include tvos-arm64, so the binary is present.
The issue is likely in how the Kotlin layer resolves or opens the database path on tvOS.
Environment
Description
PowerSyncDatabase(schema:dbFilename:)throwsPowerSyncException: Could not open database ... with 6on tvOS. The same code works fine on iOS and iPadOS.Error 6 is
SQLITE_CANTOPEN.Full error
Reproduction
What I've tried
PowerSyncDatabase() — same error
The directory exists and is writable (verified with FileManager.createDirectory), but the
Kotlin native SQLite layer still fails to open the file.
Suspected cause
openKotlinDBDefault() in KotlinPowerSyncDatabaseImpl.swift calls into the Kotlin/Native
PowerSyncDatabase factory. The Kotlin native SQLite binary may have a tvOS-specific issue
with file path handling or the powersync-sqlite-core.xcframework tvOS slice.
The powersync-sqlite-core.xcframework does include tvos-arm64, so the binary is present.
The issue is likely in how the Kotlin layer resolves or opens the database path on tvOS.