我尝试使用eas build -p android
构建我的expo react本机应用程序,但它一直失败并给出此错误:
执行com.android.build.gradle.internal.res.Aapt2CompileRunnable时出错
我已经尝试了所有方法来解决它,但我无法,为什么Gradle总是引起这么多问题?
以下是完整的错误日志:
[stderr]
FAILURE: Build completed with 2 failures.
[stderr]
1: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
Execution failed for task ':app:mergeReleaseResources'.
[stderr]
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[stderr]
> Android resource compilation failed
[stderr]
ERROR:/home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/assets_userbg.png: AAPT: error: file failed to compile.
[stderr]
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
2: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
java.lang.StackOverflowError (no error message)
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
* Get more help at https://help.gradle.org
[stderr]
BUILD FAILED in 6m 41s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 3 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
454 actionable tasks: 454 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
1条答案
按热度按时间xsuvu9jc1#
我自己能弄明白。如果任何人有这个问题,这是一个资产问题,一些或一个资产文件将在错误的格式,例如,该文件将是
.png
,但在现实中,它不会是一个PNG文件,幸运的是,日志会告诉你哪个文件有这个问题,你可以将其转换为正确的格式,并继续前进。