Android Studio 3.1.1 中的 Aapt2 错误

Aapt2 error in Android Studio 3.1.1

我将 android studio 从 2.2 更新到 3.1,它总是给我 aapt2 error 并且构建失败。我在 gradle.properties 中添加了 android.enableAapt2=false 并且我的项目构建成功并出现警告:
The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2=true' to remove this warning. It will be removed at the end of 2018.

最严重的是我无法 运行 我的移动和虚拟设备上的应用程序。错误 Failed to execute aapt

详情:
运行 建造

org.gradle..ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'.
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
    at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:78)
    at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:137)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
    at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:78)
    at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)

Java编译器
Caused by: java.util.NoSuchElementException

当我启用 AAPT2 时,日志详细信息:
Configure project :app useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\anim\abc_tooltip_exit.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_btn_colored_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_action_bar_up_container.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_ab_share_pack_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_scrubber_control_to_pressed_mtrl_005.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_search_dropdown_item_icons_2line.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_scrubber_control_to_pressed_mtrl_000.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_text_select_handle_middle_mtrl_light.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxxhdpi-v4\abc_text_select_handle_right_mtrl_dark.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_list_selector_disabled_holo_dark.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_secondary_text_material_light.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_btn_default_mtrl_shape.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_primary_text_disable_only_material_light.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-xxhdpi-v17\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_screen_simple_overlay_action_mode.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_primary_text_material_light.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_popup_menu_header_item_layout.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_ic_menu_cut_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-xhdpi-v17\abc_spinner_mtrl_am_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_text_select_handle_left_mtrl_dark.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxhdpi-v4\abc_ic_star_black_36dp.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_edit_text_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\select_dialog_multichoice_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\drawable-xhdpi-v4\notification_bg_normal.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_list_focused_holo.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_btn_radio_to_on_mtrl_000.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_btn_radio_to_on_mtrl_015.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_ic_menu_cut_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_screen_toolbar.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color-v23\abc_tint_btn_checkable.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_tooltip.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\drawable-hdpi-v4\notification_bg_normal_pressed.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_list_selector_background_transition_holo_light.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_switch_thumb_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_list_pressed_holo_dark.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\anim\abc_fade_in.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color-v23\abc_btn_colored_borderless_text_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-xxxhdpi-v17\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\layout\notification_template_custom_big.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-hdpi-v17\abc_ic_menu_cut_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_cab_background_top_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_ic_commit_search_api_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-xxxhdpi-v17\abc_ic_menu_cut_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\anim\abc_tooltip_enter.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xhdpi-v4\abc_cab_background_top_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_list_selector_disabled_holo_dark.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\drawable-v21\notification_action_background.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\layout\abc_dialog_title_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_spinner_textfield_background_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_primary_text_material_dark.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxhdpi-v4\abc_spinner_mtrl_am_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_secondary_text_material_dark.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-watch-v20\abc_dialog_material_background.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxhdpi-v4\abc_list_divider_mtrl_alpha.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\anim\abc_popup_exit.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_list_selector_disabled_holo_light.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-ldrtl-mdpi-v17\abc_ic_menu_cut_mtrl_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\anim\abc_fade_out.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\layout\notification_action.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxxhdpi-v4\abc_scrubber_control_to_pressed_mtrl_005.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxxhdpi-v4\abc_scrubber_control_to_pressed_mtrl_000.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable\abc_ic_go_search_api_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_btn_check_to_on_mtrl_000.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\drawable-xhdpi-v4\notification_bg_low_normal.9.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\color\abc_tint_edittext.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-v21\abc_btn_colored_material.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_dark.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aarbc5b5be730920c1779275773f888ad\res\layout\notification_action_tombstone.xml: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxxhdpi-v4\abc_ic_menu_paste_mtrl_am_alpha.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-hdpi-v4\abc_text_select_handle_left_mtrl_dark.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-xxxhdpi-v4\abc_ic_star_black_48dp.png: error: file not found. C:\Users\??\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar1c62276958579ac6449e5bad72b0ac\res\drawable-mdpi-v4\abc_scrubber_control_off_mtrl_alpha.png: error: file not found. Task :app:mergeDebugResources Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 5s 11 actionable tasks: 9 executed, 2 up-to-date

我的Android工作室资料
SDK Tools:26.1.1
Gradle version:4.4
插件 version:3.1
平台 version:API 27

我在其他问题中看到了一些答案,但它们对我不起作用。希望我的详细信息足以让您解决我的问题。

您可能遇到了 AAPT2 无法正确处理 windows 上的非 ascii 字符的问题。这已在最新的 3.2.0 alpha 中得到解决。尝试替换 build.gradle 文件中的 android gradle 插件以匹配:

classpath 'com.android.tools.build:gradle:3.2.0-alpha11'

注意:由于您直接从 2.2 更新到 3.1.1,修复此问题后您还可能会遇到 AAPT2 的其他错误 - 它比 AAPT 严格得多(在构建时尽早失败比 运行 进入 运行 时间崩溃)。如果您 运行 进入他们,请查看 migration guide. If the guide doesn't have enough info create a new bug here or on the issue tracker

以后可能对谁有帮助, 我通过从清单文件中删除标签 android:fullBackUpContent="" 解决了我的问题, 来自 android studio 的 Intellisense 让我把它放在那里并且由于信任,你也可能会花 12 个小时来寻找你的问题,但是,仅此而已 祝你好运

警告只是告诉您从 gradle.properties 中删除 android.enableAapt2=false。 它对我有用。