0

Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:compileDebugRenderscript NO-SOURCE Task :app:generateDebugBuildConfig UP-TO-DATE Task :app:javaPreCompileDebug UP-TO-DATE 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 download aapt2-windows.jar (com.android.tools.build:aapt2:3.6.3-6040484): No cached version 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 258ms 5 actionable tasks: 1 executed, 4 up-to-date

2 Answers2

0

Try Build -> Clean Project. Than File -> Invalidate caches/Restart. Than open the project and sync it.

0

I faced the same error. fixed by

  1. Deleting the caches folder inside bin of the .gradle folder which android studio uses found in File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle User Home

  2. Deleting .gradle folder in project.

  3. Deleting the Build folder in project.

  4. Invalidate cache/ and restart

  5. Rebuild project and done! it works

Ps1: Steps 2 and 3 can be done in projects tab, top left side of android studio.

Ps2: DON'T WORRY ABOUT DELETING THOSE FOLDERS, gradle will download them for you in the next build, provided you have network connection and Offline mode in gradle tab (top right side) is off.

Ariya
  • 46
  • 4