2

I have just started with the android studio. I am facing an error

"Could not download aapt2-osx.jar (com.android.tools.build:aapt2:3.2.1-4818971): No cached version available for offline mode"

After adding this line android.enableAapt2=false I am able to build the project but not able to run it on my phone(OnePlus 5).

I have also tried this "Could not find com.android.tools.build:aapt2:3.2.0" but it doesn't work.

Please Help...

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
Soumil Kanwal
  • 93
  • 2
  • 8

2 Answers2

4

You are running offline mode. That's why this issue is arised. You need to disable offline mode from Gradle in Android studio.

In Android Studio you can make Gradle disable by removing check mark of offline mode option:

Settings -> Build, Execution, Deployment -> Build tools -> Gradle

enter image description here

Hope this will help.

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
2

"Could not download aapt2-osx.jar (com.android.tools.build:aapt2:3.2.1-4818971): No cached version available for offline mode"

This means your gradle is working in offline mode. You need to uncheck offline mode and try to put google() repo as the first one for your build.gradle. See https://stackoverflow.com/a/51151050/8034839

shizhen
  • 12,251
  • 9
  • 52
  • 88