After upgrading Android Studio to 2.3.1 today, the Cordova project execution command reported “Error:Could not find Gradle Wrapper within Android SDK”. Details are as follows:
Trunk1 Sudo Cordova builds Android
ANDROID_HOME=/Users/fxp/Library/Android/sdk
JAVA_HOME =/Library/Java/JavaVirtualMachines jdk1.8.0 _92. JDK/Contents/Home
Reading build config file: /Users/fxp/Desktop/trunk1/build.json
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /Users/fxp/Library/Android/sdk/tools/templates/gradle/wrapper
According to the prompt, I went to check FXP/Users/Library/Android/SDK/tools/templates/gradle/wrapper directory, execute the command:
cd /Users/fxp/Library/Android/sdk/tools/templates/gradle/wrapper
Just found that this directory does not exist. So I went to check my SDK and found that there was no Templates folder in the SDK/Tools directory! It seems that SDK Tools also need to be updated after Android Studio is updated to version 2.3.1.
Then I go to http://www.androiddevtools.cn to download the SDK Tools, after download decompression, the templates folder is copied to the SDK Tools directory, cordova command will no longer quote this error again.
Read More:
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- android studio Error Gradle project sync failed. Please fix your project and try again
- Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
- Android Studio Series: after Android studio is opened, the project window will not be displayed.
- ionic android Current working directory is not a Cordova-based project.
- [Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again
- [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
- Android studio “sync project with gradle files” button disappears
- When Android Studio runs the app, it prompts Error: Please select Android SDK
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- [actual record of Android stepping on the pit] Android studio reports an error invalid gradle JDK configuration found after importing the project
- How to Fix Android Error:This Gradle plugin requires Studio 3.0 minimum
- Error: Error parsing D:\new_android\Android SDK\system-images\android-25\android-wear\armeabi-v7a\de
- Install of Android studio_ FAILED_ OLDER_ Solutions to SDK
- Android studio upgrade 4.1 plug-in error
- Re installing Android studio always fails to install SDK when installing software (solution)
- Import Android project Error:Internal error : org.gradle.tooling .BuildException: Could not execute build…
- Android Error | Failed to find target with hash string ”android-23′ in…
- Android studio import project problems summary
- When using ionic to build Android APK, Cordova error is reported: requirements check failed for JDK 1.8 or greater