生成发行版APK

时间:2019-08-20 06:42:25

标签: android apk android-build build-error

生成版本apk时出现错误(调试版本正在运行)。 我仅在Mac机器上遇到此问题,我能够在Windows机器上生成构建版本apk

我已经更改了构建工具的版本和结果

  

org.gradle.api.tasks.TaskExecutionException:任务执行失败   ':application:handleReleaseMicroApk'。在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)     在   org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)     在   org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)     在   org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)     在   org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)     在   org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)     在   org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)     在   org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)     在   org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)     在   org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)     在   org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)     在   org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.executeTask(EventFiringTaskExecuter.java:67)     在   org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:52)     在   org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:49)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)     在   org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)     在   org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)     在   org.gradle.execution.plan.LocalTask​​NodeExecutor.execute(LocalTask​​NodeExecutor.java:43)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)     在   org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:134)     在   org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:129)     在   org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.execute(DefaultPlanExecutor.java:202)     在   org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)     在   org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.run(DefaultPlanExecutor.java:129)     在   org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)     在   org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在   java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在   org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)     在java.lang.Thread.run(Thread.java:745)

     

原因:org.gradle.internal.UncheckedException:   com.android.ide.common.process.ProcessException:执行时出错   进程/Users/Folder/Library/Android/sdk/build-tools/28.0.2/aapt与   论点{转储徽章   /Users/Folder/Desktop/Release/myApp/release/wearable-myApp-release.apk}     在   org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:67)     在   org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)     在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:76)     在   org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)     在   org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)     在   org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)     在   org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:704)     在   org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:671)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 2.run(ExecuteActionsTaskExecuter.java:284)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)     在   org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)     在   org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access $ 200(ExecuteActionsTaskExecuter.java:67)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)     在   org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)     在   org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)     在   org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)     在   org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)     在   org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)     在   org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)     在   org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)     在   org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)     在   org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)     在   org.gradle.internal.execution.impl.steps.CacheStep.lambda $ execute $ 3(CacheStep.java:83)     在java.util.Optional.orElseGet(Optional.java:267)在   org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)     在   org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)     在   org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)     在   org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)     在   org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)     在   org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)     在   org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda $ execute $ 0(SkipUpToDateStep.java:89)     在java.util.Optional.map(Optional.java:215)在   org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)     在   org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)     在   org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)     ... 35更多原因:   com.android.ide.common.process.ProcessException:执行时出错   进程/Users/Folder/Library/Android/sdk/build-tools/28.0.2/aapt与   论点{转储徽章   /Users/Folder/Desktop/Release/myApp/release/wearable-myApp-release.apk}     在   com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:73)     在   com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:48)     在   com.android.builder.core.ApkInfoParser.invokeAaptWithParameters(ApkInfoParser.java:190)     在   com.android.builder.core.ApkInfoParser.getAaptOutput(ApkInfoParser.java:163)     在   com.android.builder.core.ApkInfoParser.parseApk(ApkInfoParser.java:116)     在   com.android.builder.core.AndroidBuilder.generateApkData(AndroidBuilder.java:876)     在   com.android.build.gradle.internal.tasks.GenerateApkDataTask.generate(GenerateApkDataTask.java:124)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)在   org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)...   其他73个原因:org.gradle.process.internal.ExecException:进程   '命令'/Users/Folder/Library/Android/sdk/build-tools/28.0.2/aapt''   在结束时以非零退出值134结束   org.gradle.process.internal.DefaultExecHandle $ ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:396)     在   com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:46)     ...还有83

1 个答案:

答案 0 :(得分:0)

要么点击“分析->检查代码”来检查代码中的错误,要么禁用棉绒检查,但我不建议您禁用棉绒检查。