这个问题很奇葩,但是不止我一个人遇到过。问题是这样的:
原本使用Android Studio
打包正常,这个时候我修改了代码的若干部分,例如更改了界面;再次运行,Android Studio
打出来的包居然是更改前的包。这种情况不是经常发生,但是发生之后总以为是自己代码的问题,当最终发现这个问题的时候会很郁闷浪费了这么多时间。
我同事也有遇到过这种情况,使用 gradle clean
然后再重新 assembleDebug
可以解决的这个问题。但是我还是有几个问题:
1,这是Android Studio
的bug吗?
2,如何避免这种情况的发生。
我一般都是用的最新的稳定版Android Studio
,现在用的1.5.1,buildToolVersion
是23.0.2
PHP中文网2017-04-17 16:21:22
The compilation of jetBrain is a bit strange. When using itellJ before, maven occasionally required maven clean to package. It is said that jetbrain will decide whether certain class files need to be compiled into class files based on certain judgments. The problem is not with packaging, but with compilation.
PHPz2017-04-17 16:21:22
I encountered a problem similar to yours and it has been bothering me for a long time. With the help of my friends, I found out that Kugou was responsible. These software like Kugou will occupy or detect ports related to mobile phones, which will affect adb. You can find out which software has affected your compilation by comparing the difference between the software that is open when the compilation is unsuccessful and when the compilation is successful.