2

I've added local_auth: 1.1.8 to the pubspec.yaml file of my flutter project and did flutter pub get command without any problem, but when I run the project it can't download some aar files. This is while when I add any other libraries in pub.dev to the project it works well.
I tried running the project with proxy enabled and VPN but nothing changed. Following is the error:

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

How can I fix this problem? Can I manually put the files in the path it uses if I have the file?

Mohsen Emami
  • 2,709
  • 3
  • 33
  • 40

1 Answers1

0

I know it's late but maybe it would be useful for someone else in future.

the error you are faced with is due to sanctions, you can fix it through below steps:

  • Enable a VPN
  • Invalidate cache of your android studio and restart it
  • remove global .gradle folder (it is located in ~\.gradle by default for linux systems if you haven't changed it manually)
  • sync your project using android-studio

if you always use android-studio while you had enabled VPN you won't face with such issues again. As an alternative way you can set proxy for your android-studio (through settings > http proxy) and gradle (through it's global settings)

navid
  • 13
  • 2