尝试使用 maven-android-plugin
构建我的 android 项目时出现此错误:
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.7.0:generate-sources (default-generate-sources) on project android-input-device: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.7.0:generate-sources failed: No Android API Level has been configured. Add e.g. 17 to the plugin configuration. -> [Help 1]
-尽管我已经在插件配置中设置了 SDK 版本。这是我的 POM 中的一个 fragment :
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<version>3.0.0-alpha-11</version>
<configuration>
<sdk>
<platform>11</platform>
</sdk>
<emulator>
<avd>21</avd>
</emulator>
<fork>true</fork>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
最佳答案
升级到最新版本 - 3.8.0,如果仍有问题,请反馈。这应该可以工作,但是您使用的版本非常旧,如果它不工作我也不会感到惊讶。另外 .. 该插件已重命名为 android-maven-plugin。
关于android - maven-android-plugin 未配置 Android API 级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19772208/