您的位置:首页 > 移动开发 > Android开发

使用maven构建android工程时报找不到对应sdk版本异常

2015-02-12 00:00 369 查看
摘要: Invalid SDK:Platform/API level 16 not available

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:and

oid-maven-plugin:3.3.0:generate-sources (default-generate-sources) on project l

brary: Execution default-generate-sources of goal com.jayway.maven.plugins.andr

id.generation2:android-maven-plugin:3.3.0:generate-sources failed: Invalid SDK:

Platform/API level 16 not available. This command should give you all you need:

[ERROR] D:\data\AppData\Local\Android\sdk\android-sdk\tools\android update sdk

-no-ui --obsolete --force

在网上下载对应的sdk版本放到sdk目录下的platform目录下即可

接着运行mvn eclipse:eclipse后又报以下异常

generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... orset environment variable ANDROID_HOME. -> [Help 1]

大概意思是找不到aapt这个可运行程序,进入sdk目录下的platform-tools目录下执行以下命令

mklink aapt.exe ..\build-tools\17.0.0\aapt.exe

其中17.0.0需要根据自己sdk安装情况而定,比如我电脑上安装的的21.1.1版本,那就改成

mklink aapt.exe ..\build-tools\17.0.0\aapt.exe
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: