Skip to content

Android and Desktop code is breaking after merging PR #29 #30

Closed
@Sushant-Hande

Description

@Sushant-Hande

Hi @SEAbdulbasit,

After merging pull request #29, it is breaking the code of Android and Desktop platforms.

Description

The issue is with the httpClientEngine dependency that has been passed to SpotifyApiImpl class.

Issue is at the following line
class SpotifyApiImpl(httpClientEngine: HttpClientEngine? = null) : SpotifyApi {

For iOS and Web, it is working fine but if I try to run it for Android and Desktop, it gives an error like
Cannot access class 'io.ktor.client.engine.HttpClientEngine'. Check your module classpath for missing or conflicting dependencies.

Proposed Solution

After doing some research, I got to know that if we add the platform-specific ktor client dependency to the respective platform project module then it works fine. I added following dependencies to the androidApp and desktopApp modules and then it is working fine for Android and Desktop too.

  1. androidApp - implementation("io.ktor:ktor-client-android:3.1.1")
  2. desktopApp - implementation("io.ktor:ktor-client-cio:2.3.5")

I would like to know your thoughts on this. Do you think the proposed solution is fair and efficient and we are going in the right direction? Please let me know if you know any other better approach to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions