1

我已经添加local_auth: 1.1.8pubspec.yaml我的颤振项目的文件中并且没有flutter pub get任何问题地执行命令,但是当我运行项目时它无法下载一些aar文件。这是当我将任何其他库添加pub.dev到项目中时,它运行良好。
我尝试在启用代理和 VPN 的情况下运行该项目,但没有任何改变。以下是错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find appcompat-1.2.0.aar (androidx.appcompat:appcompat:1.2.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.aar
   > Could not find appcompat-resources-1.2.0.aar (androidx.appcompat:appcompat-resources:1.2.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat-resources/1.2.0/appcompat-resources-1.2.0.aar

* 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 13s
Exception: Gradle task assembleDebug failed with exit code 1

我该如何解决这个问题?如果我有文件,我可以手动将文件放在它使用的路径中吗?

4

1 回答 1

0

我知道这已经很晚了,但也许将来对其他人有用。

您面临的错误是由于制裁,您可以通过以下步骤修复它:

  • 启用 VPN
  • 使您的android工作室的缓存无效并重新启动它
  • 删除全局文件夹(如果您没有手动更改它,它默认.gradle位于linux 系统中)~\.gradle
  • 使用同步您的项目android-studio

如果您android-studio在启用时始终使用,VPN您将不会再遇到此类问题。作为一种替代方式,您可以为您的android-studio(通过settings> http proxy)和gradle(通过它的全局设置)设置代理

于 2022-02-15T09:43:07.473 回答