使用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

相關文章
相關標籤/搜索