AAPT2 进程意外退出

and*_*dev 2 android kotlin build.gradle android-gradle-plugin

当我尝试在 Android 14 中运行我的项目时,我注意到一个错误,例如

AAPT2 进程意外退出。错误输出:aapt2.exe W 05-04 15:56:18 7008 7396 LoadedArsc.cpp:682] 未知块类型“200”。

android {

     compileSdkVersion = "android-UpsideDownCake"
    dataBinding {
        enabled = true
    }

    defaultConfig {
        applicationId "com.pro.sample"
        minSdkVersion 23

        targetSdkVersion "android-UpsideDownCake"
        versionCode 84
        versionName "5.7"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            debugSymbolLevel 'FULL'
        }
        ndkVersion "25.2.9519653"
    }
}

Run Code Online (Sandbox Code Playgroud)

这是我的应用程序级 gradle 文件,我该怎么做?

小智 5

我在将应用程序编译到目标 sdk 版本 34 时遇到了这个问题

  • 将 AGP 依赖项从 7.0.4 升级到 7.4.2
  • 将 Gradle 版本升级到 7.5
  • 升级 Gradle 插件

问题就解决了。