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

来源:2-6 Gradle 常见问题解决

慕仰7522579

2020-05-14


http://img.mukewang.com/szimg/5ebce891092601dc09900140.jpg

AAPT2 process unexpectedly exit. Error output:

http://img1.sycdn.imooc.com/szimg/5ebce89109b1cde619080762.jpg

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.

         > AAPT2 aapt2-3.6.3-6040484-windows Daemon #0: Unexpected error during compile 'C:\Users\20012101\.gradle\caches\transforms-2\files-2.1\ac4199d79d4b0412da579f23fc82cb0f\appcompat-1.1.0\res\drawable-hdpi-v4\abc_btn_switch_to_on_mtrl_00001.9.png', attempting to stop daemon.

           This should not happen under normal circumstances, please file an issue if it does.


写回答

2回答

bennyhuo

2020-05-14

aapt的问题都是资源不符合要求的问题,日志里面提到的图片按错误信息修改下就行了。

0
4
慕仰7522579
非常感谢!
2020-05-14
共4条回复

bennyhuo

2020-05-14

这个资源看着是androidx库里面的,建议同学Google一下,可能是版本问题。

0
5
慕仰7522579
回复
bennyhuo
两台都是windows10,一个是笔记本一个是台式机
2020-05-15
共5条回复

学会Kotlin 突破开发语言瓶颈

如果有一门语言可以取代Java,那么它一定是Kotlin。

1760 学习 · 481 问题

查看课程