android-studio - Android Studio 编译运行时安装的是上次打包的代码而不是修改后的代码
天蓬老师
天蓬老师 2017-04-17 16:19:22
0
2
684

这个问题很奇葩,但是不止我一个人遇到过。问题是这样的:

原本使用Android Studio打包正常,这个时候我修改了代码的若干部分,例如更改了界面;再次运行,Android Studio打出来的包居然是更改前的包。这种情况不是经常发生,但是发生之后总以为是自己代码的问题,当最终发现这个问题的时候会很郁闷浪费了这么多时间。

我同事也有遇到过这种情况,使用 gradle clean 然后再重新 assembleDebug可以解决的这个问题。但是我还是有几个问题:
1,这是Android Studiobug吗?
2,如何避免这种情况的发生。

我一般都是用的最新的稳定版Android Studio,现在用的1.5.1,buildToolVersion是23.0.2

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
Ty80

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.

PHPzhong

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template