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

Cannot access class 'dev.gitlive.firebase.storage.Data' in androidApp #638

Open
mr-kew opened this issue Sep 27, 2024 · 1 comment
Open

Comments

@mr-kew
Copy link
Contributor

mr-kew commented Sep 27, 2024

I have a function in commonMain:

import dev.gitlive.firebase.storage.Data
...
fun getData(): Data {
    ...
}

and I am trying to call it from a androidApp (from compose):

Button(
    onClick = {
        val data = getData()
        ...
    }
)

but this gives me an error: Cannot access class 'dev.gitlive.firebase.storage.Data'. Check your module classpath for missing or conflicting dependencies..

I am doing just this in my :shared:build.gradle.kts:

commonMain.dependencies {
    implementation("dev.gitlive:firebase-storage:2.1.0")
}

I tried in commonMain:

public typealias StorageData = Data

but that basically tells me that type StorageData and dev.gitlive.firebase.storage.Data are not the same in androidApp.

Am I doing something wrong? Or is it an issue with the library?

@mr-kew
Copy link
Contributor Author

mr-kew commented Oct 3, 2024

@SebastianFelon But there already is an actual class for Data (and File) in androidMain in storage.kt.

Anyway I solved it for now by doing expect/actual StorageData that is identical to dev.gitlive.firebase.storage.Data in my code and converting to it. But it feels like an issue with the library.

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