简体   繁体   English

Eclipse-在导出APK之前我应该​​清理项目吗?

[英]Eclipse - should I clean the project before exporting an APK?

After several late-night debugging nightmares, I've somehow fallen into the paranoid habit of clicking 'Project -> Clean...' in Eclipse every time I'm about to export a signed/unsigned .APK for upload to an App Store. 经过数次深夜调试恶梦后,每次我要导出签名/未签名的.APK并上传到App Store时,我都陷入了一种偏执的习惯,即在Eclipse中单击“项目->清理...”。 。 I can only assume that, some time in the distant past, it seemed to be a necessary safeguard when debugging some external JAR or otherwise. 我只能假设,在遥远的过去,调试某些外部JAR或其他方式时,这似乎是必要的保护措施。

This adds several tedious minutes to the overall export process, particularly with multiple builds and/or apps. 这会给整个导出过程增加几分钟的繁琐时间,尤其是对于多个版本和/或应用程序而言。

Is this ever a necessary step, or just paranoia? 这是否是必要的步骤,还是只是妄想症?

清理项目将重新编译您的所有类,并且它可能会解决一些问题,这些问题是资源ID更改但R.java类导致的,但已经编译成引用这些ID的类不再存在或更改。

I would consider a build system using Maven, Ant or the upcoming Gradle. 我会考虑使用Maven,Ant或即将推出的Gradle的构建系统。 This avoids problems with corrupt workspaces and lets you integrate automated testing easily; 这样可以避免工作空间损坏的问题,并使您轻松集成自动化测试。 eg UnitTests or the simple question "Does it run on Android Version XY?" 例如UnitTests或简单的问题“它可以在Android XY版上运行吗?”
I prefer Jenkins/Hudson as build server. 我更喜欢Jenkins / Hudson作为构建服务器。

Especially when you have several apps for different targets, it can be cumbersome to run all the exports manually. 尤其是当您有多个针对不同目标的应用程序时,手动运行所有导出操作会很麻烦。

Ant based build system using Jenkins: this and this 使用Jenkins的基于Ant的构建系统: this and this
New Gradle based build system: this 新摇篮基于构建系统:

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

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