简体   繁体   English

布局更改时,Ant构建失败吗?

[英]Ant build fails when layout changes?

I generate my Android projects with android create project , and it creates a default template for layout. 我用android create project生成我的Android项目,它为布局创建了默认模板。 I use ant to build (debug) my project, but what I noticed is that it gives an error "build failed" whenever I change my main.xml layout file? 我使用ant来构建(调试)我的项目,但是我注意到的是,每当我更改main.xml布局文件时,它都会产生错误“ build failed”。

What could cause that? 是什么原因造成的?

The error ANT gives is this one: ANT给出的错误是此错误:

Path/To/Project/build:xml The following error occured while executing this line: Path/To/Project/build.xml:698: null returned: 1 Path / To / Project / build:xml执行此行时发生以下错误:Path / To / Project / build.xml:698:返回null:1

It only happens when I change the layout, has anyone encountered something similar? 它仅在更改布局时发生,有人遇到过类似的事情吗?

Thank you for response in advance. 感谢您的提前答复。

Given that you use "android create project", I assume you are using an IDE, but you don't mention which one. 假设您使用的是“ android create project”,那么我假设您使用的是IDE,但是您不会提及哪一个。 If there's an option to "clean" your project, then try running this. 如果可以“清理”您的项目,请尝试运行它。 This approach resolves issues at the command line and I assume it resolves similar issues when using an IDE. 这种方法在命令行上解决了问题,并且我认为使用IDE时它可以解决类似的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM