Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory #237

Open
Aminsl76 opened this issue Oct 21, 2024 · 0 comments

Comments

@Aminsl76
Copy link

I'm using version 0.2.5-SNAPSHOT and also added the required maven repository but I keep getting this error .

scarlet-okhttp = {group = "com.tinder.scarlet" , name = "protocol-websocket-okhttp" , version.ref = "scarlet"} scarlet-moshi = {group = "com.tinder.scarlet" , name = "message-adapter-moshi" , version.ref = "scarlet"} scarlet-coroutines = {group = "com.tinder.scarlet" , name = "stream-adapter-coroutines" , version.ref = "scarlet"} scarlet-lifecycle = {group = "com.tinder.scarlet" , name = "lifecycle-android" , version.ref = "scarlet"} okhttp3 = {group = "com.squareup.okhttp3" , name = "okhttp" , version.ref = "okhttp3"} okhttp-logging = {group = "com.squareup.okhttp3" , name = "logging-interceptor" , version.ref = "okhttp3"} moshi = {group = "com.squareup.moshi" , name = "moshi-kotlin" , version.ref = "moshi"}

`val loggingInterceptor = HttpLoggingInterceptor()
val interceptor = loggingInterceptor.apply {
loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
}

val httpClient: OkHttpClient = OkHttpClient.Builder()
    .readTimeout(2000 , TimeUnit.MILLISECONDS)
    .writeTimeout(2000, TimeUnit.MILLISECONDS)
    .followRedirects(false)
    .connectTimeout(3000 , TimeUnit.MILLISECONDS)
    .addInterceptor(interceptor)
    .build()

val scarlet = Scarlet(
    OkHttpWebSocket (
        httpClient,
        OkHttpWebSocket.SimpleRequestFactory(
            { Request.Builder().url("").build()},
            { ShutdownReason.GRACEFUL }
        )
    ),
    Scarlet.Configuration (
        backoffStrategy = LinearBackoffStrategy(3000),
        messageAdapterFactories = listOf(MoshiMessageAdapter.Factory()),
        streamAdapterFactories = listOf(CoroutinesStreamAdapterFactory()),
    )
)

val bitService = scarlet.create(BitService::class.java)
bitService.authenticateUser(
    RequestDataFrame(
        messageType = 0,
        sequenceNumber = 0,
        functionName = "AuthenticateUser",
        payloadRequest = "{UserName: , Password: }"
    )
)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant