Comments (8)
add this dependency
implementation("io.ktor:ktor-client-cio:2.1.1")
from supabase-kt.
Yes you need a Ktor Client Engine, might include this in the readme
from supabase-kt.
add this dependency
implementation("io.ktor:ktor-client-cio:2.1.1")
Now getting error "java.lang.IllegalStateException: The schema must be specified"
from supabase-kt.
Also the supabase url should just be https://MY_KEY.supabase.co
If you want to have a different URL just for realtime, you can change it in the realtime config but supabase-kt handles the urls for the different modules automatically
General Info
* [x] I installed the latest version of Supabase-Kt * [x] I checked for similar bug report
What happened? (include your code)
class SplashKotlinActivity : AppCompatActivity() {
val supabaseClient = createSupabaseClient { supabaseUrl = "https://MY_KEY.supabase.co/realtime/v1" supabaseKey = "SUPABASE_KEY" install(Realtime) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_splash) initializeAndroid(supabaseClient)
}
Run app and it crases and trows errro: java.lang.ExceptionInInitializerError
Platform(s)
Android
Relevant log output
java.lang.ExceptionInInitializerError at io.ktor.client.HttpClientJvmKt.HttpClient(Unknown Source:0) at io.github.jan.supacompose.SupabaseClientImpl.<init>(SupabaseClient.kt:94) at io.github.jan.supacompose.SupabaseClientBuilder.build(SupabaseClientBuilder.kt:30) at com.wweevv.SplashKotlinActivity.<init>(SplashKotlinActivity.kt:65) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at android.app.Instrumentation.newActivity(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3389) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3620) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2183) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:241) at android.app.ActivityThread.main(ActivityThread.java:7617) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941) Caused by: java.lang.IllegalStateException: Failed to find HTTP client engine implementation in the classpath: consider adding client engine dependency.
from supabase-kt.
add this dependency
implementation("io.ktor:ktor-client-cio:2.1.1")
Now getting error "java.lang.IllegalStateException: The schema must be specified"
This exception is thrown if you try to listen for db changes without actually specifying a schema.
See https://github.com/supabase-community/supabase-kt/tree/master/Realtime under Listening for Postgres changes for more informations
from supabase-kt.
This actually bugs me. Even though I like the DSL style for settings, it doesn't force the consumer to provide required arguments and results in crash at runtime and it increases difficulty for new users. So maybe we should force required args as function arguments.
e. g.
createSupabaseClient(
supabaseUrl = "https://MY_KEY.supabase.co/realtime/v1"
supabaseKey = "SUPABASE_KEY"
) {
install(Realtime)
...
}
Even more so now when this library is part of supabase community (congrats btw :) great job). So there is actually a danger of people using it :D
from supabase-kt.
This actually bugs me. Even though I like the DSL style for settings, it doesn't force the consumer to provide required arguments and results in crash at runtime and it increases difficulty for new users. So maybe we should force required args as function arguments. e. g.
createSupabaseClient( supabaseUrl = "https://MY_KEY.supabase.co/realtime/v1" supabaseKey = "SUPABASE_KEY" ) { install(Realtime) ... }Even more so now when this library is part of supabase community (congrats btw :) great job). So there is actually a danger of people using it :D
Thanks, yea you are right, maybe I should change that!
from supabase-kt.
I'd close this issue to keep things clean. Feel free to open another issue when you have any issues!
from supabase-kt.
Related Issues (20)
- [Feature request]: Use Ktor resources for routing or a separate object for routes
- [Bug]: Column.Raw not removing line breaks
- [Feature request]: Update to Kotlin 2.0.0
- [Bug]: PostgREST filter logical operator unexpected behaviour HOT 1
- [Question]: Is it really necessary that if the authentication with the keys is incorrect it will exit the application with a FATAL ERROR? HOT 2
- [Question]: Is there a possibility to log in anonymously and make it persistent? HOT 6
- [Feature request]: Add support for new private channels
- [Bug]: supabase-runtime fails to connect on iOS devices HOT 3
- [Bug]: Extension functions in RealtimeExt.kt don't have to be suspend HOT 7
- [Question]: Trouble Implementing Password Reset on Android with Supabase HOT 3
- [Bug]: Auth refresh sessions is not working correctly HOT 9
- [Feature request]: App To App OAuth for Discord HOT 1
- [Feature request]: Simplify realtime flows for postgres changes
- [Question]: I think it's better to move the samples to root project? HOT 1
- [Feature request]: Improve Exception on Cancellation HOT 2
- [Bug]: [Storage] Empty file is created on Dashboard when pass empty `ByteArray` to upload function
- [Bug]: All object keys must match HOT 8
- [Bug]: Error: Missing one of these types: signup, email_change, sms, phone_change HOT 2
- [Feature request]: remove session, emit `SIGNED_OUT` when JWT `session_id` is invalid
- [Question]: How cancel supabase request? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supabase-kt.