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

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

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

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

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

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

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

-no-ui --obsolete --forceorm


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

接着运行mvn eclipse:eclipse后又报如下异常android-sdk

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]io

大概意思是找不到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

相关文章
相关标签/搜索