My version of cordova 6.3.1 and there was a stupid glitch. Doing cordova build --release android

Running command: /home/admin/ProgrammaJS/NEW/hooks/after_prepare/010_add_platform_class.js /home/admin/ProgrammaJS/NEW add to body class: platform-android ANDROID_HOME=/home/admin/android-studio/ JAVA_HOME=/home/admin/jdk Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: /home/admin/android-studio/tools/templates/gradle/wrapper 

But the SDK version is the latest android-studio-ide-145.3276617 and released on September 19. How to fix this bug

  • The directory / home / admin / android-studio / should be the platform-tools and build-tools, platforms. If not, the variable is set incorrectly. - Serge Markov
  • There is no such thing! Even the search in the folder is not. I downloaded the archive 700 megabytes - Kirill Fyodorov

2 answers 2

Usually, with the default settings, the SDK will be installed in $ HOME / Android / Sdk, respectively, you need to change ANDROID_HOME

proof

  • admin@linux:~/ProgrammaJS/NEW$ cordova build --release android Running command: /home/admin/ProgrammaJS/NEW/hooks/after_prepare/010_add_platform_class.js /home/admin/ProgrammaJS/NEW add to body class: platform-android Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually. Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory. - Kirill Fedorov
  • / NEW $ export ANDROID_HOME = ~ / android-studio admin @ linux: ~ / ProgrammaJS / NEW $ echo $ ANDROID_HOME / home / admin / android-studio admin @ linux: ~ / ProgrammaJS / NEW $ cordova build --release android Running command : /home/admin/ProgrammaJS/NEW/hooks/after_prepare/010_add_platform_class.js / home / admin / ProgrammaJS / NEW add to body class: platform-android ANDROID_HOME = / home / admin / android-studio JAVA_HOME = / home / admin / jdk Error: Could not find the gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: / home / admin / android-studio / tools / templates / gradle / wrapper ` - Kirill Fyodorov
  • Here is such a bug - Cyril Fedorov
  • android-studio this is sdk - Kirill Fedorov
  • Android Studio in the bundle includes itself an SDK. When installing it puts it in a separate directory - see screenshot. SDK can be delivered separately. Do you have something in $ HOME / Android / Sdk? - Serge Markov

Suffered an hour and a half in due time. The problem is that the hail had to be set with the pens myself. For example, with this tool ( http://sdkman.io/install.html ) this one line:

 sdk install gradle 4.0.2