安装maven插件时出现故障

时间:2013-05-21 10:55:28

标签: android eclipse maven

我正在尝试使用maven和eclipse构建一个Android应用程序项目。

我创建了一个'hello world'文件,然后将其转换为maven项目。添加com.google.android依赖项和android-maven-plugin 3.5.3后,当我通过将目标设置为android:apk运行Build Maven项目时,我收到以下错误 -

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Final_Maven1 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- android-maven-plugin:3.5.3:apk (default-cli) @ Final_Maven1 ---
[INFO] Copying local assets files to combined assets directory.
[INFO] Enabling debug build for apk.
[INFO] /home/developer/adt-bundle-linux-x86_64-20130219/sdk/platform-tools/aapt [package, -f, -M, /home/developer/Final_Maven/AndroidManifest.xml, -S, /home/developer/Final_Maven/res, --auto-add-overlay, -A, /home/developer/Final_Maven/target/generated-sources/combined-assets/assets, -I, /home/developer/adt-bundle-linux-x86_64-20130219/sdk/platforms/android-8/android.jar, -F, /home/developer/Final_Maven/target/Final_Maven1-0.0.1-SNAPSHOT.ap_, --debug-mode]
[INFO] /home/developer/Final_Maven/res/values-v11/styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
[INFO] /home/developer/Final_Maven/res/values-v14/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.042s
[INFO] Finished at: Tue May 21 16:13:19 IST 2013
[INFO] Final Memory: 7M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:apk (default-cli) on project Final_Maven1: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /home/developer/Final_Maven && /home/developer/adt-bundle-linux-x86_64-20130219/sdk/platform-tools/aapt package -f -M /home/developer/Final_Maven/AndroidManifest.xml -S /home/developer/Final_Maven/res --auto-add-overlay -A /home/developer/Final_Maven/target/generated-sources/combined-assets/assets -I /home/developer/adt-bundle-linux-x86_64-20130219/sdk/platforms/android-8/android.jar -F /home/developer/Final_Maven/target/Final_Maven1-0.0.1-SNAPSHOT.ap_ --debug-mode, Result = 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the `following articles:`
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

请帮帮我。

1 个答案:

答案 0 :(得分:1)

我必须按照maven-android-plugin issue 379上的说明解决类似的问题。这表明交换到3.6.0+的maven-android-plugin也应该有效?

对于记录,修复方法是运行以下命令:

cd <android-sdk>/platform-tools
ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib
ln -s ../build-tools/17.0.0/aidl aidl