Kotlin 1.9.24 + Supabase: gotrue imports not resolving despite dependencies being found
Hey Kotlin devs! 👋 Could really use some help with version compatibility
I've been working on my Android app called "Forager" and just spent the last few hours in dependency version hell trying to upgrade to Supabase 3.x. I'm hoping someone here has been through this pain and can save me from more hair-pulling! 😅
What I'm trying to do:
Build a cool location-based app with auth, but I'm completely stuck on getting Supabase working with modern Kotlin versions.
My current setup:
Kotlin 1.9.24 (was on 2.1.0 but backed off due to compatibility issues)
Android Gradle Plugin 8.7.3
KSP 1.9.24-1.0.20
Hilt 2.53.1
Compose BOM 2024.12.01
The problem:
No matter what I try, I keep getting Unresolved reference: gotrue and Unresolved reference: GoTrue errors. The dependencies show up correctly in my dependency tree, but the imports just won't resolve. It's driving me crazy because everything looks right!
What I've tried:
Supabase 3.1.4 with auth-kt (metadata version conflicts)
Supabase 2.6.1 with gotrue-kt (imports don't resolve)
Supabase 2.5.4 with gotrue-kt (still trying this one)
Multiple cache clears, gradle restarts, sacrifice to the gradle gods, etc.
My dependency setup:
kotlinimplementation(platform("io.github.jan-tennert.supabase:bom:2.6.1"))
implementation("io.github.jan-tennert.supabase:gotrue-kt:2.6.1")
implementation("io.github.jan-tennert.supabase:postgrest-kt:2.6.1")
implementation("io.ktor:ktor-client-okhttp:2.3.12")
The question:
What's the actual working combination of Kotlin + Supabase versions for Android in early 2025? I feel like I'm missing something obvious, but I've been staring at this for hours and I'm starting to question my life choices 😭
I love what you all have built with Supabase - the features are exactly what I need for my app. I just want to get past this setup hurdle so I can start building cool stuff with it!
Has anyone successfully gotten Supabase working with recent Kotlin versions? I'd be forever grateful for a working build.gradle.kts snippet or just knowing I'm not the only one who's struggled with this.
Thanks in advance for any help! 🙏 Really appreciate this amazing community.
2 Replies
Supabase Kt 3.x.x+ requires Kotlin 2.0.0+. and also Ktor 3.x.x+. You will face metadata version conflict when there's any of your app dependencies does not meet the version of Kotlin and Ktor (ex: I faced this issue when use with firebase-ai when it uses Ktor < 3.x.x).
So if your current build is not ready for supabase-kt 3.x.x yet, there's a lot of conflict if you try to upgrade the version, so just go with 2.x.x and prepare for 3.x.x later once your setup is ready
Thank you so much! That was exactly the issue.
You were spot on - I was using Kotlin 1.9.24 with Supabase 2.6.1 and it was causing metadata version conflicts that broke my ML Kit barcode scanning imports. Downgrading to Supabase 2.5.4 (which is compatible with Kotlin 1.9.24) immediately fixed the problem.
Before your advice, I was going down a rabbit hole trying to fix ML Kit dependencies when the real culprit was the version mismatch. The barcode imports work perfectly now and my build is clean.
Really appreciate you taking the time to explain the Kotlin 2.0+ requirement for Supabase 3.x+ and the Ktor dependency chain. Saved me hours of debugging!
For anyone else with similar issues: check your Kotlin version against the Supabase compatibility matrix before upgrading. The version conflicts can manifest as seemingly unrelated import failures in other libraries.
Thanks again! 🙏
Update: Still working through finding the exact compatible Supabase 2.x version for Kotlin 1.9.24 - the version conflicts are definitely the issue as you identified. Thanks for pointing me in the right direction