Compile error while trying to compile android app

2020-03-24 10:53发布

问题:

I am trying to compile my android app in ant and I keep getting this message:

BUILD FAILED
K:\build.xml:359: aaptexec doesn't support the "basename" attribute

why does this happen? I am using the template from android sdk 4.

Thanks, Jason

回答1:

Please, provide full ant output with stack trace. You're probably using mismatched sdk/target platform versions. This might cause use of unsupported build system features from your build.xml. Upgrade your sdk, and update build configuration with android tool:

android update project --name <project_name> --target <target_ID> --path <path_to_your_project>

See http://developer.android.com/guide/developing/other-ide.html for android command details



回答2:

Just had the same issue and resolved the problem by using the right ant build.xml, probably the one Google really maintains. It's located at android-sdk\tools\ant\main_rules.xml and resolves this issue.



标签: android ant