https://kotlinlang.org logo
#compose
Title
# compose
a

Alexander Suraphel

11/28/2021, 1:35 PM
Trying to run the
todoapp
inside
compose-jb
and getting the following error:
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.compose.material:material:1.1.0-beta01.
AAR metadata file: /Users/alexander/.gradle/caches/transforms-3/137251a10d2c5151ea1d3a5bd29928e0/transformed/jetified-material-1.1.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
How do if fix this? I’ve tried
clean
->
build
and “Invalidate cache and restart”
m

Michael Paus

11/28/2021, 2:22 PM
It’s funny that I had the exact same (and a lot of other) problem(s) with the same example just moments ago. This is what I did to fix it (from my notes):
Copy code
In android/build.gradle.kts set
    compileSdkVersion(31)
        targetSdkVersion(30)
to avoid
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.compose.material:material:1.1.0-beta01.
AAR metadata file: /Users/mpaus/.gradle/caches/transforms-3/b4ec6f3b44de3015d7560f9b6ba22fac/transformed/jetified-material-1.1.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.

Don't set targetSdkVersion to 31 because that leads to other problems (which should actually be fixed of course too.)
I spent half of the day on this todo example to get all configurations updated so that most of it compiled and ran. I failed on the web version though. Is it really so difficult to keep the build settings up-to-date?
🙏 1
a

Alexander Suraphel

11/28/2021, 3:03 PM
Thanks @Michael Paus. Your fix worked for me!
c

Colton Idle

11/28/2021, 6:10 PM
@Alexander Suraphel be sure to file a bug on the jb compose repo
👌 1
a

Alexander Suraphel

11/29/2021, 11:13 AM
@Colton Idle Done .
👍 1