android studio2.1.1,Android Studio 2.1.1 running old .apk file

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

Start of with, I tried all the suggestions in SO and none helped me.

Suggestion1,Suggestion2,Suggestion3.

I'm doing some debugging (Just running the app on my device through Android Studio) and I noticed that time after time, changes that I made in the app does not applied to the .apk AS is running.

The only solution I know is to delete the app from my device and then running again and it compiles with the changes I made in the code. Alternatively, I restart Android Studio and it fixes that too.

I try all suggestions on the site including: file -> invalidate Chaches / Restart -> invalidate, and changing my Run -> Edit Configuration settings but turned out unsuccesfully.I also read all the documentation here but It just repeats the answers here.

My Run -> Edit Configuration

6c1555302777729326ca3efa0910d9ec.png

So what's up with Android Studio not applying my code changes?

EDIT:

So for now still no fix suggestion is working. Even my File -> Invalidate Caches / Restart -> Invalidate and Restart not working either.

回答1:

There is a bug with the new Instant Run feature, the app is not reloaded correctly.

You can disable Instant Run in File > Settings > Build, Execution, Deployment > Instant Run and uncheck the first checkbox. Now when you click the Run button, the app will be refreshed correctly.

回答2:

How do you deploy the changes in your app to the device? I used to do it by pressing the green triangle (the "play" button) which is the first on the right from the name of the app in the top toolbar. In the new AS version, when you make changes to your app, that button gets a small thunderbolt icon next to the green triangle, like here:

6c1555302777729326ca3efa0910d9ec.png

This new icon means that AS will try to do an "Instant Run", ie. to make a hot swap or a warm swap to your app as it is running. Sadly, this hasn't been working as advertised for me (I have been using the new AS for a week now). Instead, I go for the "ReRun selected configuration" button, the fifth on the right, with the gray square and the curved arrow in order to send the changed .apk to the device.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值