gpt4 book ai didi

android-studio - Android Studio说失败:更新至3.6.2后,构建失败,并出现异常

转载 作者:行者123 更新时间:2023-12-03 04:55:21 26 4
gpt4 key购买 nike

我所有的代码运行正常。但是当我将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应用程序。但更新后无法正常工作。有什么办法吗?

最佳答案

该错误表明无法下载依赖项,因为您处于离线模式或没有可用的Internet连接。
尝试步骤

  • 尝试关闭Gradle的离线模式。您被
  • 关闭
    View > Tool Windows > Gradle

    在Gradle窗口的顶部,单击Gradle窗口中的Toggle Offline Mode按钮。 You can refer below image
  • 检查Internet连接并重新构建。

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

    关于android-studio - Android Studio说失败:更新至3.6.2后,构建失败,并出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61209444/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com