新建Android Studio的Kotlin项目,运行报错:AAPT2 process unexpectedly exit. Error output:

新建的Android Studio Kotlin项目运行时出现AAPT2错误,尝试更新Windows运行时库、更改Gradle版本、Android Studio版本及appcompat包版本等方法无效。问题源于添加androidx.appcompat包后导致,可能与Gradle 3.6.3不兼容。解决方案是删除appcompat包依赖,并修改styles.xml和AndroidManifest中涉及AppTheme的部分,将AppCompatActivity替换为Activity。
摘要由CSDN通过智能技术生成

一、创建新的Android Studio Kotlin项目,直接运行后报错:

AAPT2 process unexpectedly exit. Error output:

详情如下:

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:processDebugResources'.

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

   > Failed to transform artifact 'appcompat.aar (androidx.appcompat:appcompat:1.1.0)' to match attributes {artifactType=android-compiled-dependencies-resources}.

      > Execution failed for AarResourcesCompilerTransform: C:\Users\20012101\.gradle\caches\transforms-2\files-2.1\ac4199d79d4b0412da579f23fc82cb0f\appcompat-1.1.0.

         > AAP
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值