如何解决Android Studio中关于:app:checkloggAarMetadata的此错误?

a2mppw5e  于 2023-10-23  发布在  Android
关注(0)|答案(1)|浏览(203)

当我运行我的应用程序代码,我得到以下错误在控制台

  • 哪里出错了:执行任务“: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选项运行以获取更多日志输出。运行--扫描以获得完整的见解。

在29秒内构建故障排除:Gradle任务assembleDebug失败,退出代码为% 1
我试过很多方法,但都无法用正确的方法解决这个问题。

izkcnapc

izkcnapc1#

打开文件**build.gradle.kts(Module :app)**并更改compileSdk

  • compileSdk = 29*

  • compileSdk = 33*

相关问题