我试图在 Android Studio 中打开一个 Ionic2 项目,但它在事件日志中显示以下错误:Gradle 同步失败:未找到已安装的构建工具.安装 Android 构建工具版本 19.1.0 或更高版本.请参阅 IDE 日志了解更多详细信息(帮助 | 显示日志)"屏幕截图
我之前看到过类似的问题(也可能是 Ionic2 或 Cordova 的最新版本之一破坏了某些东西 -> https://github.com/driftyco/ionic/issues/10604).
从 gradle.build 文件或项目结构中更改buildToolsVersion"或compileSdkVersion"的版本没有帮助.
在C:UsersGabyAppDataLocalAndroidsdkuild-tools24.0.3"下,我安装了 24.0.3 构建工具版本.
环境变量中的 path 变量也正确指示了路径
有一次,我用android update sdk -u -a"安装了所有构建工具,但又发生了同样的错误.
有人知道这个问题的合适解决方法吗?
非常感谢
你需要写正确的环境变量".请参阅:https://developer.android.com/studio/command-line/variables一个>
窗户:
setx ANDROID_SDK_ROOT "C:android-sdk-windows"setx PATH "%PATH%;%ANDROID_SDK_ROOT% ools;%ANDROID_SDK_ROOT%platform-tools"
Mac OS X
export ANDROID_SDK_ROOT=/<安装位置>/android-sdk-macosx导出 PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
Linux
export ANDROID_SDK_ROOT=/<安装位置>/android-sdk-linux导出 PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
<块引用>
更新:ANDROID_HOME 已弃用,ANDROID_SDK_ROOT 现在是正确的变量
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
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).
Changing the version of "buildToolsVersion" or "compileSdkVersion" from gradle.build file or from Project Structure didn't help.
Under "C:UsersGabyAppDataLocalAndroidsdkuild-tools24.0.3", I installed the 24.0.3 build tool version.
The path variable from environment variables indicates also the path correctly
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 ?
Many thanks
You need to write the correct "Environment Variables". See: https://developer.android.com/studio/command-line/variables
Windows:
setx ANDROID_SDK_ROOT "C:android-sdk-windows"
setx PATH "%PATH%;%ANDROID_SDK_ROOT% ools;%ANDROID_SDK_ROOT%platform-tools"
Mac OS X
export ANDROID_SDK_ROOT=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
Linux
export ANDROID_SDK_ROOT=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
Update: ANDROID_HOME is deprecated, ANDROID_SDK_ROOT is now the correct variable
这篇关于“Gradle 同步失败:未找到已安装的构建工具.安装 Android 构建工具 19.1.0 或更高版本"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!