AAPT2 错误:解析协议缓冲区时,字符串字段'aapt.pb.String.value'包含无效的 UTF-8 数据



我在构建时遇到了一个问题。日志如下:

org.grade.execution.MultipleBuildFailures:生成已完成,包含1故障。在org.gradle.sitialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:358)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:300)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:292)在org.gradle.internal.operations.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutior.java:174)在org.gradle.internal.operations.DefaultBuildOperationExecution.run(DefaultBuildOperationExecutior.java:90)在org.gradle.internal.operations.DelegatingBuildOperationExecutiator.run(DelegatingBuildOperationExecutior.java:31)在org.gradle.sinitialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:219)在org.gradle.sinitialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)在org.gradle.sinitialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)在org.gradle.internal.iocation.GradleBuildController$1.call(GradleBuildControll.java:77)在org.gradle.internal.iocation.GradleBuildController$1.call(GradleBuildControll.java:74)在org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaceService.java:154)在org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingworkerLeaseServices.java:38)在org.gradle.internal.iocation.GradleBuildController.doBuild(GradleBuildControll.java:96)在org.gradle.internal.iocation.GradleBuildController.run(GradleBuildControll.java:74)在org.gradle.tooling.internal.provider.runner.ClientProviderdBuildActionRunner.run(ClientProviderdBuildactionRunner.java:68)在org.gradle.selauncher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)在org.gradle.selauncher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)在org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)在org.gradle.selauncher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildingActionRunner.java:50)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:300)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:292)在org.gradle.internal.operations.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutior.java:174)在org.gradle.internal.operations.DefaultBuildOperationExecution.run(DefaultBuildOperationExecutior.java:90)在org.gradle.internal.operations.DelegatingBuildOperationExecutiator.run(DelegatingBuildOperationExecutior.java:31)在org.gradle.selauncher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildingActionRunner.java:45)在org.gradle.tooling.internal.provider.SubscripteBuildActionRunner.run(SubscripteBuildactionRunner.java:51)在org.gradle.selauncher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecutor.java:47)在org.gradle.selauncher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecutor.java:44)在org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:79)在org.gradle.selauncher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecutor.java:44)在org.gradle.selauncher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecutor.java:30)在org.gradle.selauncher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildingActionExecuter.java:39)在org.gradle.selauncher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildingActionExecuter.java:25)在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)在org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuild ActionExecuteR.java:36)在org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuild ActionExecuteR.java:25)在org.gradle.tooling.internal.provider.ParallelsmConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)在org.gradle.tooling.internal.provider.ParallelsmConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)在org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsvalidingActionExecutor.java:59)在org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsvalidingActionExecutor.java:31)在org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReport ingActionExecutor.java:59)在org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReport ingActionExecutor.java:44)在org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)在org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)在org.gradle.selauncher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)在org.gradle.selauncher.daemon.server.exec.BuildCommandOnly.exexecute(BuildCommandOnly.java:36)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecactionLogger.java:26)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfsSingleUsed daemon.java:34)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)在org.gradle.selauncher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)网址:org.gradle.util.Swaper.swap(Swapper.java:38)org.gradle.selauncher.daemon.server.exec.ForwardClientInput.exexecute(ForwardClientInput.java:72)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.LogAndCheckHealth.exexecute(LogAndCheckHealth.java:55)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)在org.gradle.selauncher.daemon.server.exec.BuildCommandOnly.exexecute(BuildCommandOnly.java:36)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildingEnvironment.java:81)在org.gradle.selauncher.daemon.server.exec.BuildCommandOnly.exexecute(BuildCommandOnly.java:36)在org.gradle.selauncher.daemon.server.api.DemonCommandExecution.proceed(DaemonCommentExecution.java:122)在org.gradle.selauncher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespandWithBusy.java:50)在org.gradle.selauncher.daemon.server.DemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)在org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)在org.gradle.internal.concurrent.ManagedExecutiorImpl$1.run(ManagedExecutiorimpl.java:46)在java.util.concurrent.ThreadPoolExecutiator.runWorker(ThreadPoolExecutiator.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.api.tasks.TaskExecutionException:任务执行失败":app:processReleaseResources"。在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)在org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirector.CreatingTaskexecuter.java:51)在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUptoDateTaskExecutor.java:59)在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutput CachingstateExecuter.java:54)在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmpitySourceFilesTaskexecuter.java:101)在org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecution.execute(SkipTaskWithNoActionsExecuter.java:59)在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnyIfTaskexecuter.java:54)在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExcessionTaskExecuter.java:34)在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:300)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:292)在org.gradle.internal.operations.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutior.java:174)在org.gradle.internal.operations.DefaultBuildOperationExecution.run(DefaultBuildOperationExecutior.java:90)在org.gradle.internal.operations.DelegatingBuildOperationExecutiator.run(DelegatingBuildOperationExecutior.java:31)在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)在org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecution.execute(DefaultTaskExecutionGraph.java:277)在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecution.execute(DefaultTaskExecutionGraph.java:262)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutiator$ExecutitorWorker$1.execute(DefaultTaskPlanExecutior.java:135)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutiator$ExecutitorWorker$1.execute(DefaultTaskPlanExecutior.java:130)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutiator$ExecutitorWorker.execute(DefaultTaskPlanExecutior.java:200)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutitor$ExecutitorWorker.executeWithWork(DefaultTaskPlanExecutiator.java:191)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutar.java:130)…6更多原因:com.android.builder.internal.apt.v2.Aapt2异常:android资源链接失败输出:[libprotobuf ERRORexternal/protobuf/src/google/protobuf/wire_format_lite.cc:532]字符串字段"aapt.pb.String.value"在分析时包含无效的UTF-8数据协议缓冲区。如果要发送原始数据,请使用"字节"类型字节。/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/metermediates/res/merged/release/values_values.arsc.flat:错误:无法读取资源表:无法分析ResourceTable。错误:分析覆盖层失败。

命令:/Users/mac/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/d54be48ff34f6bb6bf84364d9553ae5a/apt2-3.2.1-488971-osx/apt2链接-I\/用户/mac/Library/Android/sdk/platforms/Android-28/Android.jar\--舱单\/Users/mac/AndroidStudioProjects/Crowdsource android/app/build/mediamediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml\-o\/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/metermediates/processed_res/release/processReleaseResources/out/resources-release.ap_\-R\@/Users/mac/AndroidStudioProjects/Crowdsource android/app/build/metermedias/incremental/processReleaseResources/resources list for resources release.ap_.txt\--自动添加覆盖\--java\/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/engenerated/not_namespaced_r_class_sources/release/processReleaseResources/r\--proguard\/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/metermediates/proguard rules/release/aapt_rules.txt\--proguard主索引\/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/metermediates/legacy_multidex_apt_derived_proguard_rules/release/processReleaseResources/manifest_keep.txt\--自定义程序包\me.ele.cowdsource\-0\apk\-c\zh\--输出文本符号\/用户/mac/AndroidStudioProjects/Crowdsource android/app/build/metermediates/symbols/release/R.txt\--无版本矢量守护程序:位于的AAPT2 AAPT2-3.2.1-4818971-osx守护程序#0com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:177)在com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Deamon.kt:103)在com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAptDaemon.link(Aapt2DeamonManager.kt:176)在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:823)在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:525)在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTaskAction(LinkApplicationAndroidResourcesTask.java:275)在com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)位于sun.reflect.GeneratedMethodAccessor452.reinvoke(未知源)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)位于java.lang.reflect.Method.ioke(Method.java:498)org.gradle.internal.reflect.JavaMethod.reinvoke(JavaMethod.java:73)org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsSaskExecuter.java:131)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:300)在org.gradle.internal.operations.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutiator.java:292)在org.gradle.internal.operations.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutior.java:174)在org.gradle.internal.operations.DefaultBuildOperationExecution.run(DefaultBuildOperationExecutior.java:90)在org.gradle.internal.operations.DelegatingBuildOperationExecutiator.run(DelegatingBuildOperationExecutior.java:31)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)…还有34个

这似乎是AAPT错误,我的gradle插件版本是3.2.1

最后,我们在build.gradle 中找到了解决方案

buildTypes { release { zipAlignEnabled true // pseudoLocalesEnabled true } }

我们删除了pseudoLocalesEnabled,然后它可以成功构建,但我不认为这是主要原因。

相关内容

  • 没有找到相关文章

最新更新