android studio中clean工程和rebuild工程的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/24083706/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between clean project and rebuild project in android studio
提问by Fukkong
What is the difference between Clean Projectand Rebuild Project(in Android Studio)?
Clean Project和Rebuild Project(在 Android Studio 中)有什么区别?
- I had a problem with the R fileaboutresids, so I changed the file extension fromgiftopngand then [my build failed.]
- I found the solution was to Rebuild Project. This prompts my question above.
- 我的R fileabout有问题resids,所以我将文件扩展名从 更改gif为png,然后 [我的构建失败。]
- 我发现解决方案是Rebuild Project. 这提示了我上面的问题。
回答by Larry Schiefer
回答by MBH
What I experienced,
我所经历的,
When you do clean, it removes the binaries inside buildfolders, and postpones building them again to the next run.
当您执行清理时,它会删除构建文件夹中的二进制文件,并将它们再次构建到下一次运行。
When you do rebuild, it does clean and rebuild for those files inside buildfolder, which rebuilt again in the next run. It does not rebuild the APK!! Which is really weird.
当您进行重建时,它会清理并重建build文件夹中的那些文件,这些文件会在下次运行时再次重建。它不会重建APK!!这真的很奇怪。
so:
所以:
Clean removes the build folders contents.
Clean 删除构建文件夹的内容。
Rebuild removes the build folder's contents. And builds some binaries; not including the APK!
重建删除构建文件夹的内容。并构建一些二进制文件;不包括APK!
BTW, I am using Android studio 2.0 Preview 7.
顺便说一句,我使用的是 Android studio 2.0 Preview 7。

