3

i update Android studio yesterday ( 3-4-2020),i get this error :

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.

any one can help, thanks

  • It says offline mode. Are you offline or have enabled offline mode from the Android Studio menus? The issue seems to be that a file cannot be downloaded because of offline mode. – Per Christian Henden Apr 05 '20 at 10:39

5 Answers5

1

go to ->File -> project structures -> if any suggestions ->update and compile all->apply ->ok and disable offline mode

Jeevan Rupacha
  • 3,055
  • 1
  • 15
  • 29
0

It's an internet connection problem. it happens to me from time to time. I usually use a VPN to fix it. and make sure your Gradle setting is not in offline mode.

Shynline
  • 1,497
  • 1
  • 13
  • 18
0

I solved it! Earlier, after I set up everything on my Android Studio, I switched the Gradle Compiler work mode to --offline in Command-line Options in Settings:

File > Settings > Build, Execution, Deployment > Compiler

This solved the issue. Right after I solved it, I saw a similar solution and concluded that copy pasting the problem from build log may not always work, you should read it attentively, stop and think, and make a conscious search.

Let me know if it solves your problem too, if not we will try to come up with something else.

0

Toogle the offline mode in the upper right section. This should solve your problem

Warithly
  • 11
  • 1
  • 6
0

just go to the gradle section on top right corner, and switch off 'Toggle Offline Mode' (on the top toolbar) and you are good to go

momvart
  • 1,737
  • 1
  • 20
  • 32
Balaji
  • 1