我正在尝试使用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请帮帮我。
发布于 2013-06-06 05:09:15
我不得不按照maven-android-plugin issue 379上的说明来解决类似的问题。这表明切换到maven-android-plugin的3.6.0+也应该是可行的?
对于记录,修复方法是运行以下命令:
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 https://stackoverflow.com/questions/16668309
复制相似问题