Android Studio编译失败:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessEx

Android Studio编译报错:

java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process D:\android\sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I D:\android\sdk\platforms\android-26\android.jar -M \\?\D:\android\test\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\android\test\build\intermediates\res\merged\debug -m -J \\?\D:\android\test\build\generated\source\r\debug -F D:\android\test\build\intermediates\res\debug\resources-debug.ap_ -D \\?\D:\android\test\build\intermediates\multi-dex\debug\manifest_keep.txt --custom-package com.test -0 apk --preferred-density xxhdpi --output-text-symbols \\?\D:\android\test\build\intermediates\symbols\debug --no-version-vectors}    

 

com.android.ide.common.process.ProcessException: Error while executing process D:\android\sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I D:\android\sdk\platforms\android-26\android.jar -M \\?\D:\android\test\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\android\test\build\intermediates\res\merged\debug -m -J \\?\D:\android\test\build\generated\source\r\debug -F D:\android\test\build\intermediates\res\debug\resources-debug.ap_ -D \\?\D:\android\test\build\intermediates\multi-dex\debug\manifest_keep.txt --custom-package com.test -0 apk --preferred-density xxhdpi --output-text-symbols \\?\D:\android\test\build\intermediates\symbols\debug --no-version-vectors}    

 

org.gradle.process.internal.ExecException: Process 'command 'D:\android\sdk\build-tools\26.0.2\aapt.exe'' finished with non-zero exit value 1    

命令行中执行如下命令查看详细报错(需先切换到当前工程目录下):

  Windows: gradlew clean build --stacktrace

  MAC/Linux: ./gradlew clean build --stacktrace

查看详细的报错,发现存在如下报错:

D:\android\test\build\intermediates\bundles\debug\res\layout\dialog_voice_detecting.xml:20: AAPT: No resource identifier found for attribute 'lottie_autoPlay' in package 'com.test'
D:\android\test\build\intermediates\bundles\debug\res\layout\dialog_voice_detecting.xml:20: AAPT: No resource identifier found for attribute 'lottie_fileName' in package 'com.test'
D:\android\test\build\intermediates\bundles\debug\res\layout\dialog_voice_detecting.xml:20: AAPT: No resource identifier found for attribute 'lottie_loop' in package 'com.test'
D:\android\test\build\intermediates\res\merged\debug\layout\dialog_voice_detecting.xml:20: error: No resource identifier found for attribute 'lottie_autoPlay' in package 'com.test'
D:\android\test\build\intermediates\res\merged\debug\layout\dialog_voice_detecting.xml:20: error: No resource identifier found for attribute 'lottie_fileName' in package 'com.test'
D:\android\test\build\intermediates\res\merged\debug\layout\dialog_voice_detecting.xml:20: error: No resource identifier found for attribute 'lottie_loop' in package 'com.test'

原因:

   xml中使用了lottie,但是gradle文件中没有引入依赖。
解决方案:

  build.gradle文件中增加:

implementation 'com.airbnb.android:lottie:2.8.0'

安卓开发技术分享:https://blog.csdn.net/yinxing2008/article/details/84555061

你可能感兴趣的:(Android Studio编译失败:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessEx)