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

Build from source with local jellyfin-sdk-kotlin jar dependencies. #1394

Closed
calwi opened this issue May 22, 2024 · 3 comments
Closed

Build from source with local jellyfin-sdk-kotlin jar dependencies. #1394

calwi opened this issue May 22, 2024 · 3 comments

Comments

@calwi
Copy link

calwi commented May 22, 2024

I am trying to build this project using the sdk libraries build from the jellyfin-sdk-kotlin repo.

I have had some success getting these two repos to work locally,

By updating the build.gradle.kts Module file as: (I've needed to include direct references to ktor from Android Studio to fix another unresolved reference error for io.ktor.http.HttpStatusCode in WebViewUtils.kt)

    val sdkVersion = findProperty("sdk.version")?.toString()
    //implementation(libs.jellyfin.sdk) {
    //    // Change version if desired
    //    when (sdkVersion) {
    //        "local" -> version { strictly(JellyfinSdk.LOCAL) }
    //        "snapshot" -> version { strictly(JellyfinSdk.SNAPSHOT) }
    //        "unstable-snapshot" -> version { strictly(JellyfinSdk.SNAPSHOT_UNSTABLE) }
    //    }
    //}
    implementation("io.ktor:ktor-client-core:2.3.11")
    implementation("io.ktor:ktor-client-cio:2.3.11")
    implementation("io.ktor:ktor-client-websockets:2.3.11")
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar", "*.jar"))))

Which branch of the sdk repo best suits which branch from the jellyfin-android repo? I have tried release-1.4.z as the closest match to the version specified in the libs.version.toml file, but receive an error when trying to build, as follows:

Unresolved reference: context on line 13 of ApiModule.kt

This needs to be uncommented for building android as I understand it.

val apiModule = module {
    // Jellyfin API builder and API client instance
    single {
        createJellyfin {
            context = androidContext()
            clientInfo = ClientInfo(name = Constants.APP_INFO_NAME, version = Constants.APP_INFO_VERSION)
        }
    }
    single { get<Jellyfin>().createApi() }
}

What am I missing to get this to build locally so I can work with the sdk at the same time?

Thanks.

@nielsvanvelzen
Copy link
Member

Instructions for using a development version of the SDK are in the kotlin-sdk README. In short you need to publish to your local maven repository and then set sdk.version=local in the gradle.properties file.

You should not add other dependencies at all. No need for modifying the gradle build files.

@calwi
Copy link
Author

calwi commented May 22, 2024

OK. Thanks Niels. I'm not using a local Maven repository, which I no doubt should be! I will look into it.

@calwi
Copy link
Author

calwi commented May 22, 2024

All good now. Thanks again!

@calwi calwi closed this as completed May 22, 2024
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

2 participants