Closed Monabr closed 2 months ago
Can you post your build gradle, sounds like you might be adding the dependancy incorrectly.
@Reedyuk I believe nothing special here
sourceSets {
...
commonMain.dependencies {
implementation("dev.gitlive:firebase-analytics:2.0.0")
implementation("dev.gitlive:firebase-auth:2.0.0")
implementation("dev.gitlive:firebase-database:2.0.0")
implementation("dev.gitlive:firebase-firestore:2.0.0")
implementation("dev.gitlive:firebase-functions:2.0.0")
implementation("dev.gitlive:firebase-messaging:2.0.0")
implementation("dev.gitlive:firebase-storage:2.0.0")
implementation("dev.gitlive:firebase-installations:2.0.0")
implementation("dev.gitlive:firebase-config:2.0.0")
implementation("dev.gitlive:firebase-perf:2.0.0")
implementation("dev.gitlive:firebase-crashlytics:2.0.0")
}
...
}
What version of the JDK are you targeting? just wondering if its an issue with an older version being used?
@Reedyuk
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf(
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions",
"-Xexpect-actual-classes"
)
}
}
}
android {
compileOptions {
isCoreLibraryDesugaringEnabled = true <--- added with your liblary
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
Just for reference, when you enable this property, does your project work? Sorry, i have not come across this issue before, so its interested to see. I think this only affects users who are using Android Build tools 4.x.x I have been using 7.x.x and never came across this.
@Reedyuk I don't really know for now. Currently I am writing implementations for IOS of my common classes. But without isCoreLibraryDesugaringEnabled
gradle did not sync.
My gradle version: 8.5.2
gradle is fine, my guess is you have this somewhere:
com.android.tools.build:gradle:4.x.x
And this is version 4.x.x
You highlight that maybe what we need is an example KMP(with compose) that uses the library.
@Reedyuk After searching I see that I don't use com.android.tools.build
.
I have:
com.android.application
com.android.library
with gradle version if we are talking about android plugins.
Whats your min android version you are targeting?
This seems to shed some light: https://medium.com/androiddevelopers/support-for-newer-java-language-apis-bca79fc8ef65 Looks to me like its more related to android than it is this project. I would imagine you would have to add that property for any other libs.
You highlight that maybe what we need is an example KMP(with compose) that uses the library.
@Reedyuk I have reproduce example:
./gradlew assembleDebug
Project will not build and throw the error I posted.
Whats your min android version you are targeting? Looks to me like its more related to android than it is this project. I would imagine you would have to add that property for any other libs.
I have way over 21 min sdk
minSdk = 28
targetSdk = 35
ok thanks for the report
Desugaring is required for the config module as of #553 @Reedyuk and @Monabr due to the use of Kotlinx datetime which requires it as well. Only core library desugaring is required https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#using-in-your-projects
Desugaring is required for the config module as of #553 @Reedyuk and @Monabr due to the use of Kotlinx datetime which requires it as well. Only core library desugaring is required https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#using-in-your-projects
According to the docs If you target Android devices running below API 26
we need desugaring. And according to this web-site https://apilevels.com/ API 26 is 95.5% of users.
I believe you can safely update minSdk to 26.
Did some digging around and it seems fine to just disable core library desugaring on the module itself. Should only be added on the app implementing the SDK. See #618
I believe this should be fixed.