Reputation: 2498
I've heard recently about Gradle's Version Catalog and decided to give it a try... Everything setup, Gradle wrapper set to gradle-7.0-rc-2
and everything runs fine and I am able to build.
Android Studio, however won't identify nested dependencies, showing this exception:
Cannot access class 'org.gradle.accessors.dm.LibrariesForLibs.AndroidxLibraryAccessors'. Check your module classpath for missing or conflicting dependencies
app/build.gradle.kts
implementation(libs.androidx.coreKtx)
gradle/libs.versions.toml
androidx_coreKtx = "androidx.core:core-ktx:1.5.0-beta03"
How may I get rid of that AS error?
Upvotes: 6
Views: 4710
Reputation: 1191
It looks like issue was fixed by IntellIJ team (https://youtrack.jetbrains.com/issue/KTIJ-1221) a while ago, but stable Android Studio uses fairly old IntelliJ platform.
On the bright side, it appears to be fixed in the new Android Studio Canary (Android Studio Arctic Fox | 2020.3.1 Canary 15
works fine).
I've created an issue on Google's bugtracker. I know the chance is slim, but maybe they notice it and backport the fix to 4.2:
https://issuetracker.google.com/issues/187326581
Upvotes: 1
Reputation: 2892
Have you tried to rename androidx_coreKtx
to androidx-coreKtx
? After that change you should be able to use implementation(libs.androidx.coreKtx)
Make sure that you have enableFeaturePreview("VERSION_CATALOGS")
in your settings.gradle(.kts)
Upvotes: -1