Monorepo containing a Swift-powered REST API, an Android app (Jetpack Compose + Swift JNI), and a shared Swift/Kotlin Multiplatform iOS client.
- Swift toolchain via Swiftly (matching the Android SDK snapshot)
- Android SDK/NDK +
adb - JDK 21 (newer versions break the SwiftJava toolchain)
- Node.js 18+
- API –
cd server && npm install && npm start - Swift package –
cd Android+Swift/Coasters && ./gradlew :swiftcore:copyJniLibs - CLI – in
Android+Swift/Corerunswift run CoasterCLI(server must be running) - Android app – from
Android+Swift/Coastersrun./gradlew :app:assembleDebug(or open in Android Studio) - iOS app – open
iOS+KMP/iosApp/iosApp.xcodeprojand run from Xcode
- Source of truth for the Swift domain model lives in
Android+Swift/Core/Sources/Core. Before building the Android app you must copy any changes intoAndroid+Swift/Coasters/swiftcore/Sources/RollerCoasterCore(the vendored module Android consumes). - After every Swift edit run the regeneration pipeline from
Android+Swift/Coasters:Skipping these steps leaves Android running stale./gradlew :swiftcore:copyJniLibs # rebuilds Swift, refreshes JNI libs + bindings ./gradlew clean assembleDebug # or use Android Studio’s Clean/Rebuild
.sofiles or generated Java stubs.
- Gradle can’t find
jni.h/JAVA_HOME– export JDK 21 in every shell:export JAVA_HOME=$(/usr/libexec/java_home -v 21). :swiftcore:copyJniLibsfails – double-check the Swift toolchain (Swiftly snapshot) and Swift SDK path; rerun the task after copying the updated Swift sources.- Swift 6 concurrency errors in generated JNI code – the build ships with
Sources/RollerCoasterCore/ConcurrencySupport.swift(and the matching file underCore/), which marks the raw JNI handles as@unchecked Sendable; make sure that file is present and you’re on the latestswift-javamain before rerunning./gradlew :swiftcore:copyJniLibs(any remainingTask {}warnings are benign). - Android UI shows empty results – the app just wraps the Swift JSON feed; make sure the Express server (
server/) is running and the emulator can reachhttp://10.0.2.2:3000.