Closed tateisu closed 7 months ago
@tateisu any other changes beside this one? e.g. order of the plugins or such?
Migrating to build.gradle.kts usually have a lot of changes, so it's hard to determine what's affected. Do you have any recommendations on what order the plugins should be applied?
I'd suggest it's best to apply the plugin last: https://github.com/mikepenz/AboutLibraries/blob/develop/app/build.gradle#L5 (after the android plugin)
thanks. my app/build.gradle.kts
is:
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.kapt")
id("com.github.triplet.play") version "3.7.0"
id("com.google.devtools.ksp")
id("com.google.firebase.crashlytics")
id("com.google.gms.google-services")
id("androidx.navigation.safeargs.kotlin")
id("realm-android")
id("com.mikepenz.aboutlibraries.plugin")
}
...
I recently created a new private project which also uses build.gradle.kts
files, but doesn't show the problem.
Did you resolve the problem? Or can you maybe reproduce it in the sample app?
Sorry for the delayed response
Hey, I would like to report having the exact same issue.
It happens because of androidx.compose.material3:material3-android:1.2.0-beta02
conflicting with com.mikepenz:aboutlibraries-compose-m3:10.10.0
@Nyabsi can you please provide more details how the material3 lib conflicts with the compose-m3
lib?
Yes, sure.
I am not too sure on the specifics but for some reason when I include these following libraries:
implementation("com.mikepenz:aboutlibraries-core:10.10.0")
implementation("com.mikepenz:aboutlibraries-compose-m3:10.10.0")
implementation("androidx.compose.material3:material3-android:1.2.0-beta02")
It will work just fine without
com.mikepenz:aboutlibraries-compose-m3:10.10.0
because some how already includes the compose components for material3-android
and this causes race condition.
removing
implementation("androidx.compose.material3:material3-android:1.2.0-beta02")
will solve the conflict, but it also means I am stuck on older material3 components on my project.
Oh. I think It might be because the -m3
dependency have the compose-multiplatform variant.
Can you try to do:
implementation("com.mikepenz:aboutlibraries-compose-m3:10.10.0@aar")
or
implementation("com.mikepenz:aboutlibraries-compose-m3-android:10.10.0@aar")
To force load it without transitive dependencies
Yes, I can test that shortly. I'll get back asap.
The proposed workaround works. I can now use com.mikepenz:aboutlibraries-compose-m3-android
by adding @aar
at the end of the implementation.
But now it will throw java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/collections/immutable/ExtensionsKt;
and com.mikepenz:aboutlibraries-compose-m3
throws this error.
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform aboutlibraries-compose-m3-10.10.0.aar (com.mikepenz:aboutlibraries-compose-m3:10.10.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.status=release}.
> Could not find aboutlibraries-compose-m3-10.10.0.aar (com.mikepenz:aboutlibraries-compose-m3:10.10.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/mikepenz/aboutlibraries-compose-m3/10.10.0/aboutlibraries-compose-m3-10.10.0.aar
@Nyabsi the immutable collections dependency is a transitive depdendency of the compose
modules. So as you only include the singular dependency for compose (but none of the dependent ones) you will have to add this dependency yourself.
you can see what compose-m3
normally depends on:
https://github.com/mikepenz/AboutLibraries/blob/develop/aboutlibraries-compose-m3/build.gradle.kts#L103
So you want to add kotlinx.collections.immutable: https://github.com/Kotlin/kotlinx.collections.immutable?tab=readme-ov-file#using-in-your-projects
@mikepenz that solves the issue for me, thank you. I hope this may also help the original author of this issue to solve their problem, unless it is already solved.
For the original author, please report back if this is still happening, and if it may be the same problem as @Nyabsi mentioned.
Closing for the time being.
Hey,
I use build.gradles
files and I get the same logs as the original author.
In my case, the issue arises if I update the AGP and Gradle versions.
agp_version = '8.1.4'
with Gradle version 8.0.2
: works without any issues.agp_version = '8.2.0'
with Gradle version 8.2
, (or later versions): issue arises.do you have the configuration cache enabled @HikmatTatariAllone ?
@mikepenz Yes, I did have it enabled, and disabling it fixed my issue. Thank you.