title: Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android
body: <p>I know there are lots of questions similiar to this one, but i couldn't find a solution for my problem in any of those. Besides, I'll provide details for my specific case.</p>
  
  <p>I coded an Ionic project in Ubuntu 16.04 LTS, and now I have to build it for release. So I run the command:</p>
  
  <pre><code>cordova build --release android
  </code></pre>
  
  <p>And I'm shown the following error:</p>
  
  <pre><code>Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
  Looked here: /home/user/Android/Sdk/tools/templates/gradle/wrapper
  </code></pre>
  
  <ul>
  <li>I don't have this <code>templates/gradle/wrapper</code> directory.</li>
  <li>My Android Studio is 2.3, the latest version for now</li>
  <li>Android SDK Platform-Tools 25.0.3</li>
  <li>Android SDK Tools 25.3.1</li>
  <li>All Android versions from 2.1 (Eclair) to 7.1.1 (Nougat)</li>
  </ul>
  
  <p>After extensive research, I put all the Android Studio-related environment variables in the file <code>/etc/environment</code>. So now it looks like this:</p>
  
  <pre><code>PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/game:/home/&lt;user&gt;/Android/Sdk:/home/&lt;user&gt;/Android/Sdk/tools:/home/&lt;user&gt;/Android/Sdk/platform-tools"
  
  ANDROID_HOME=/home/&lt;user&gt;/Android/Sdk
  export ANDROID_HOME
  
  JAVA_HOME=/usr/lib/jvm/java-8-oracle
  export JAVA_HOME
  
  GRADLE_HOME=/opt/android-studio/gradle/gradle-3.2
  export GRADLE_HOME
  </code></pre>
  
  <p>Now, for the sake of testing the environment variables, I run the following commands:</p>
  
  <pre><code>source /etc/environment
  echo $PATH
  echo $ANDROID_HOME
  echo $JAVA_HOME
  echo $GRADLE_HOME
  </code></pre>
  
  <p>And all the path variables are correctly displayed.</p>
  
  <p><strong>So, it looks like the environment variables are like they should be according to the various similar questions and in tutorials i've searched. Does anyone know what am I doing wrong? Why do I still get the Gradle Wrapper error?</strong></p>