当我运行我的应用程序代码,我得到以下错误在控制台
- 哪里出错了:执行任务“:app:checkDebugAarMetadata”失败。
执行com.android.build.gradle.internal.tasks时出现故障。检查AAR元数据时发现CheckAarMetadataWorkAction 2问题:
1. Dependency 'androidx.window:window-java:1.0.0-beta04' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-29.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
2. Dependency 'androidx.window:window:1.0.0-beta04' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-29.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
- 试试看:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。运行--扫描以获得完整的见解。
- 在https://help.gradle.org获取更多帮助
在29秒内构建故障排除:Gradle任务assembleDebug失败,退出代码为% 1
我试过很多方法,但都无法用正确的方法解决这个问题。
1条答案
按热度按时间izkcnapc1#
打开文件**
build.gradle.kts(Module :app)
**并更改compileSdk从
到