“Gradle sync failed:找不到已安装的构建工具。安装Android构建工具版本19.1.0或更高版本“
我正在尝试在Android Studio中打开Ionic2项目,但它在事件日志中出现以下错误:
Gradle sync失败:找不到已安装的构建工具。安装Android版本工具版本19.1.0或更高版本。请参阅IDE日志以获取更多详细信息(帮助|显示日志)
SCREENSHOT
I'm trying to open an Ionic2 Project in Android Studio, but it gives me the following error into the Event Log: "Gradle sync failed: No installed build tools found. Install the Android build tools version 19.1.0 or higher. Consult IDE log for more details (Help | Show Log)" SCREENSHOT
我之前看过一个类似的问题(也许是最新版本之一) Ionic2或Cordova破坏了某些东西 - > https://github.com/driftyco/ionic/issues/10604 )。
I have seen a similiar problem stated before (also maybe one of the latest release of Ionic2 or Cordova broke something -> https://github.com/driftyco/ionic/issues/10604).
从gradle.build文件或Project Structure更改buildToolsVersion或compileSdkVersion的版本没有帮助。
Changing the version of "buildToolsVersion" or "compileSdkVersion" from gradle.build file or from Project Structure didn't help.
在C:\Users\Gaby \ AppData \ Local \ Android \\\ddk \ build-tools \24.0.3下,我安装了24.0.3构建工具版本。
Under "C:\Users\Gaby\AppData\Local\Android\sdk\build-tools\24.0.3", I installed the 24.0.3 build tool version.
环境变量中的路径变量也表明路径正确
The path variable from environment variables indicates also the path correctly
那一刻,我用android update sdk -u -a安装了所有构建工具,但同样的错误发生了。
At one moment, I had all build-tools installed with "android update sdk -u -a" but again, the same error occured.
有没有人知道这个问题的合适解决方法?
Does anybody know a suitable workaround to this issuse ?
非常感谢
您需要编写正确的环境变量。 https://spring.io/guides/gs/android/
You need to write the correct "Environment Variables". https://spring.io/guides/gs/android/
Windows:
set ANDROID_HOME=C:\\android-sdk-windows set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Mac OS X
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Linux
export ANDROID_HOME=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools