gpt4 book ai didi

Android Maven 找不到工具 'aapt'

转载 作者:IT王子 更新时间:2023-10-28 23:55:42 26 4
gpt4 key购买 nike

我正在尝试学习本教程:

http://www.gdgankara.org/2012/11/01/step-by-step-android-development-with-maven/

但是在设置环境并创建一个项目之后,在“运行为\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 tutorial 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- android-maven-plugin:3.1.1:generate-sources (default-generate-sources) @ tutorial ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.889s
[INFO] Finished at: Sat May 18 00:32:12 CEST 2013
[INFO] Final Memory: 8M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project tutorial: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1: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=... or set environment variable ANDROID_HOME. -> [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/PluginExecutionException

我尝试了很多次,但都没有成功。我在 Windows7 64 位上安装了 Eclipse Juno,安装了 APK 工具和 Maven 3.0.5。

对于 maven 员工来说,这似乎是一个众所周知的问题:

https://code.google.com/p/maven-android-plugin/issues/detail?id=104

但它应该从岁月中解决......

我的环境用户变量:

M2_HOME=C:\Program Files\Java\apache-maven-3.0.5

ANDROID_HOME=C:\adt-bundle-windows-x86_64-20130514\sdk

我的环境系统变量:

Path=......;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools;%ANDROID_HOME%\platforms;%M2_HOME%\bin;%ANDROID_HOME%\build-tools\android-4.2.2

有人知道如何锻炼这个陷阱吗?

谢谢!

最佳答案

我在使用google最新的ADT并尝试编译bootstrap android平台时也遇到了同样的问题。

最新的 r17 构建分离出 aapt 到 build-tools 文件夹。因此它是 maven-android-plugin 无法支持的。

查看讨论的问题 here .

尝试并工作:

cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/android-4.2.2/aapt aapt
ln -s ../build-tools/android-4.2.2/lib lib
ln -s ../build-tools/android-4.2.2/aidl aidl

某些安装可能使用 API 版本进行结构化:

cd $ANDROID_HOME/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

请记住,正如其他答案所指出的,这已在最新版本 (>3.5.3) 的 Android Maven 插件中得到修复。

关于Android Maven 找不到工具 'aapt',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16619143/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com