简体   繁体   English

如何解决任务':app:mergeDebugResources'的执行失败。 在 android 工作室 3.6.2

[英]How to resolve Execution failed for task ':app:mergeDebugResources'. in android studio 3.6.2

i'm completely new to android studio.我对 android 工作室完全陌生。 I created my 1st project and set up emulator but when i run the application i got the error below and the build output: build failed.我创建了我的第一个项目并设置了模拟器,但是当我运行应用程序时出现以下错误,并且构建 output: build failed。 please help me out, thanks请帮帮我,谢谢

FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.出了什么问题:任务“:app:mergeDebugResources”执行失败。

    Could not resolve all files for configuration ':app:_internal_aapt2_binary'.无法解析配置“:app:_internal_aapt2_binary”的所有文件。 Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.无法解析 com.android.tools.build:aapt2:3.6.2-6040484。 Required by: project:app No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.要求:项目:应用程序没有 com.android.tools.build:aapt2:3.6.2-6040484 的缓存版本可用于离线模式。 No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode. com.android.tools.build:aapt2:3.6.2-6040484 没有缓存版本可用于离线模式。

Hello (found a solution), After a lot of research and a lot of tests.您好(找到解决方案),经过大量研究和大量测试。 I finally found the answer to the error I got (exactly the same as yours) ^^.我终于找到了我得到的错误的答案(和你的完全一样)^^。 It probably happened when I updated Android Studio..: Anyway here's what I did and it worked, Open any project.当我更新 Android Studio 时可能发生了这种情况..:无论如何,这就是我所做的并且它有效,打开任何项目。 and do "FILE" > "PROJECT STRUCTURE..." (or the shortcut Ctrl+Alt+Shift+S).并执行“文件”>“项目结构...”(或快捷键 Ctrl+Alt+Shift+S)。 Go to the project section (at the very top) of the window that just appeared and choose the latest version of Android Gradle Puglin (= Android Studio version) and Gradle (now it's 3.6.2 for AS and 6.3 for Gradle): Once done. Go to the project section (at the very top) of the window that just appeared and choose the latest version of Android Gradle Puglin (= Android Studio version) and Gradle (now it's 3.6.2 for AS and 6.3 for Gradle): Once done . "APPLY" & "OK". “应用”和“确定”。

Second thing to do: "VIEW" > "TOOL WINDOWS" > "GRADLE".第二件事:“视图”>“工具窗口”>“梯度”。 With the window that just opened, click on "TOGGLE OFFLINE MODE", the penultimate icon at the top of the window (it MUST NOT be highlighted anymore), and keep this window for a little while.使用刚刚打开的 window,单击“TOGGLE OFFLINE MODE”,即 window 顶部的倒数第二个图标(不能再突出显示),并保留此 Z05B8C74CBD96FBF2DE4C1A352702FBF4 一会儿。 Now build your project/create the apk file to run Gradle and download the necessary, since you have changed version (Connect your pc to the internet.), Normally (at least for me).现在构建您的项目/创建 apk 文件以运行 Gradle 并下载必要的,因为您已经更改了版本(将您的电脑连接到互联网。),通常(至少对我来说)。 AS will download what you need and you'll just have to wait a bit,As soon as the build is finished (which is already good news ^^). AS 会下载你需要的东西,你只需要稍等一下,一旦构建完成(这已经是好消息了 ^^)。 go back to the Gradle window and reactivate "TOGGLE OFFLINE MODE" (it MUST be highlighted), Rebuild your project to make sure it works (I don't know if this step is necessary, but better too much than too little!), and you're done! go 回到 Gradle window 并重新激活“TOGGLE OFFLINE MODE”(必须突出显示),重建您的项目以确保它有效,但如果有必要,我不要太了解这个步骤,但最好不要这样做)你就完成了! No more errors and no more need to connect to the Internet!不再有错误,不再需要连接到互联网!

I hope this has been useful;)我希望这很有用;)

These resources need to be installed and it can't be synced offline so you need to connect to internet and then sync build.gradle again in order to download these resources.这些资源需要安装,并且无法离线同步,所以您需要连接到互联网,然后再次同步 build.gradle 才能下载这些资源。 Hope this will help you.希望这会帮助你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android Studio中修复“任务':app:mergeDebugResources执行失败”? - How to fix “Execution failed for task ':app:mergeDebugResources” in android studio? Android - 错误:任务执行失败':app:mergeDebugResources' - Android - Error:Execution failed for task ':app:mergeDebugResources' 如何修复任务执行失败':app:mergeDebugResources' - How to fix Execution failed for task ':app:mergeDebugResources' Android Studio抛出-任务':app:mergeDebugResources'的执行失败,没有服务器可以处理请求 - Android studio throw - Execution failed for task ':app:mergeDebugResources' No server to serve request 错误:任务':app:mergeDebugResources'的执行失败 - Error:Execution failed for task ':app:mergeDebugResources' Android Studio 项目构建 Output 错误:任务:应用程序:合并调试资源失败 - Android Studio Project Build Output Error: Task :app:mergeDebugResources FAILED 错误:任务“:app:mergeDebugResources”的执行失败。 - Error:Execution failed for task ':app:mergeDebugResources'. 任务':app:mergeDebugResources'的错误_Execution失败 - Error _Execution failed for task ':app:mergeDebugResources' 任务“:app:mergeDebugResources”执行失败。 错误 - Execution failed for task ':app:mergeDebugResources'. Error 无法处理文件 - Android Studio (app:mergeDebugResources) - Failed to crunch file - Android studio (app:mergeDebugResources)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM