title: Android Studio - Rebuild Project - Could not download aapt2-4.1.0-6503028-windows.jar
body: <p>This is the configuration I have on my project:</p>
  <ul>
  <li>Android Studio 4.1 (September 23, 2020)</li>
  <li>Android Gradle Plugin Version 4.1.0</li>
  <li>Gradle Version 6.7</li>
  <li>Compile SDK 29 (Android 10.0 Q)</li>
  <li>Build Tools 29.0.2</li>
  <li>Min Sdk 17</li>
  <li>Target Sdk 26 (Android 8.0 Oreo)</li>
  </ul>
  <p>In the build.gradle of the project I have</p>
  <pre><code>buildscript {
      repositories {
          google()
          jcenter()
      }
  }
  ....
  allprojects {
      repositories {
          google()
          jcenter()
          maven { url &quot;https://jitpack.io&quot; }
      }
  }
  </code></pre>
  <p>When I use the &quot;Build&gt; Rebuild Project&quot; command in Build Output I get this error:</p>
  <pre><code>Execution failed for task ':app:mergeDebugResources'.
  Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
  Could not download aapt2-4.1.0-6503028-windows.jar (com.android.tools.build:aapt2:4.1.0-6503028): No cached version available for offline mode
  
  Possible solution:
   - Disable offline mode and rerun the build
  </code></pre>
  <ul>
  <li>I tried with the &quot;Toggle Offline Mode&quot; in the Gradle panel (both to set it and to remove it), but the error still occurs.</li>
  <li>I tried to clean the whole .gradle folder but same result.</li>
  <li>I also created an emulator with API 30 because they suggested it would download the missing package, but it didn't change the situation.</li>
  <li>I tried to manually download the jar (<a href="https://maven.google.com/web/index.html?q=aapt2#com.android.tools.build:aapt2:4.1.0-6503028" rel="noreferrer">https://maven.google.com/web/index.html?q=aapt2#com.android.tools.build:aapt2:4.1.0-6503028</a>) and put it in libs, but the error still comes out.</li>
  </ul>