Android Studio表示失败:更新至3.6.2后,构建失败并出现异常 [英] Android Studio says FAILURE: Build failed with an exception after updating to 3.6.2

查看:463
本文介绍了Android Studio表示失败:更新至3.6.2后,构建失败并出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的代码都运行良好.但是,当我将android studio更新为3.6.2时,它显示:

Executing tasks: [:app:assembleDebug] in project /home/AK_47/AndroidStudioProjects/MyProject

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
   > Could not resolve 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.
      > No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.

* 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 1s
5 actionable tasks: 1 executed, 4 up-to-date

我试图制作一个ANDROID应用程序.但是更新后无法正常工作.有解决办法吗?

I was trying to make an ANDROID application. But after updating it isn't working. Any solution?

推荐答案

该错误表示由于您处于脱机模式或没有可用的Internet连接而无法下载依赖项. 尝试步骤

The error indicates that the dependency can't be downloaded because you are in offline mode or have an active Internet connection is not available. Steps to try

  1. 尝试关闭Gradle的离线模式.您被
  2. 关闭

View > Tool Windows > Gradle

从菜单栏中.在Gradle窗口的顶部,单击Gradle窗口中的Toggle Offline Mode按钮.

from the menu bar.Here On the top of the Gradle window ,click on Toggle Offline Mode button in the Gradle window.

  1. 检查Internet连接并重新构建.

希望这个答案会有所帮助...

Hope this answer will help...

这篇关于Android Studio表示失败:更新至3.6.2后,构建失败并出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆