当前位置: 首页 > 知识库问答 >
问题:

React本机android构建失败:app:mergeReleaseResources

甄德寿
2023-03-14

该应用程序运行良好,事实上我已经创建了两个版本的APK。这次我修改了代码,来做/gradlew assembleRelease,我得到了以下错误:

失败:生成失败,出现异常。

  • 哪里出错了:任务执行失败:app: mergeRelaseResources。

生成准备发布的健康APK。

  1. 我已经完成了签名和签名。密钥存储在正确的位置/Android/应用程序

以下是完整的stacktrace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeReleaseResources'.Close stacktrace
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:79)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

共有2个答案

闻人嘉木
2023-03-14


在运行模拟器时,构建成功,模拟器工作正常,但由于构建失败,我不能使用发布apk。

庾君博
2023-03-14

我相信这可能是这个问题的重复:

错误执行失败的任务: app: mergeRelaseResources'构建APK

当我尝试构建一次时,问题出现了,它在android/app/src/main/res/上创建了绘图目录。然后当我第二次尝试时,它显示了这个错误执行任务失败:应用程序:合并发布资源构建APK

我只是删除了可拖放的-*dirs,它的工作。

要删除目录可绘制--*

rm -rf android/app/src/main/res/drawable-*
 类似资料:
  • 我正在设置环境,开始开发react原生应用程序。我不断发现以下错误: PS C:\map\development\learnreact\react native\helloworld 配置项目:应用程序在不一致的位置“C:\Users\bheka\AppData\Local\Android\Sdk\platform tools”(预期为“C:\Users\bheka\AppData\Local\A

  • 我在启动“React-Native Run-Android”时出错了 有人能帮我吗? 失败:生成失败,出现异常。 > 其中:脚本'c:\users\wayan\desktop\android\app\node_modules@react-native-community\cli-platform-android\native_modules.gradle'行:191 错误:评估设置“应用程序”时出

  • 我已经尝试了多种解决方案在线无法使构建工作 我得到任务“:app:mergereleaseResources”的执行失败。 [raw/app]C:\users\lenovo\documents\github\marist-mobile-app\android\app\src\main\res\raw\app.json[raw/app]C:\users\lenovo\documents\github

  • 错误,无法安装应用程序。确保您已经设置了Android开发环境:https://reactnative.dev/docs/environment-setup。运行带有--verbose标志的CLI以获得更多详细信息。错误:命令失败:./gradlew app:installdebug-preactnativedevserverport=8081 失败:生成失败,出现异常。 在6s中生成失败 MY

  • 我已经下载了Android SDK工具。解压缩文件,然后在目录工具中运行这些命令 生成失败/home/live/devel/android/tools/myapp/BUILD.xml:90:执行此行时出现以下错误:/home/live/devel/android/tools/ant/BUILD.xml:108:taskdef使用类加载器AntClassLoader找不到类com.android.a