java.lang.IllegalStateException: buildToolsVersion is not specified.解决办法

Posted 天外野草

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.IllegalStateException: buildToolsVersion is not specified.解决办法相关的知识,希望对你有一定的参考价值。

如果大家在cordova的项目中执行: cordova build android 命令,
遇到如下问题:

Error: Command failed: cd /Users/tyler/workspace/webstormspace/NewsApp/releases/dev/www && cordova build android
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:645)
at com.android.build.gradle.BasePlugin 10.call(BasePlugin.java:608)atcom.android.build.gradle.BasePlugin 10.call(BasePlugin.java:605)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
at com.android.build.gradle.BasePlugin.lambda createTasks 1(BasePlugin.java:603)
at com.android.build.gradle.BasePlugin$$Lambda$29/1202404165.execute(Unknown Source)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDisError: Command failed: cd /Users/tyler/workspace/webstormspace/NewsApp/releases/dev/www && cordova build android

解决办法是:

更新你的Android SDK build tools, 到最新版本即可,可能你更新了android platform。

以上是关于java.lang.IllegalStateException: buildToolsVersion is not specified.解决办法的主要内容,如果未能解决你的问题,请参考以下文章