So i have been trying to run my project but i am encountering issues with com.google.android.material:material:1.10.0-alpha01 due to the "UpsideDownCake" API requirement.
This is the error message :
Dependency ‘com.google.android.material:material:1.10.0-alpha01’ requires libraries and applications that
depend on it to compile against codename "UpsideDownCake" of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Use a different version of dependency ‘com.google.android.material:material:1.10.0-alpha01’,
or set compileSdkPreview to "UpsideDownCake" in your build.gradle
file if you intend to experiment with that preview SDK.
Any help would be much appreciated.
2
Answers
As described in their release notes for 1.10.0-alpha01, you need to use
android-UpsideDownCake
ascompileSdkVersion
in your app levelbuild.gradle
file.However if you don’t really need to be on the alpha version, use the latest stable version instead:
It works fine in this version:
implementation 'com.google.android.material:material:1.8.0-alpha01'
When I upgraded to the recommended new version, I was getting an error. After reviewing the log, I realized that I needed to upgrade
compileSdkPreview
for the new version to work correctly.If you are going to use the new version, you should add the following.
implementation 'com.google.android.material:material:1.10.0-alpha01'
Make sure you download the SDK.
build.gradle(:app)
you should update the value in the file as below:compileSdkVersion "android-UpsideDownCake"
For detailed information, you can check: https://developer.android.com/about/versions/14/setup-sdk#kts