Android Studio 2.0即时运行无法正常工作 [英] Android Studio 2.0 Instant Run Not Working

查看:106
本文介绍了Android Studio 2.0即时运行无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此新功能即时运行"并非始终如所描述的那样工作. 我只是在文本中修改了绘画颜色,然后立即运行,它重新开始活动!但是,在修改了一些其他代码之后,Instant Run效果很好. 我想念什么吗?

This new feature, Instant Run, is not working always as described. I just modify a paint color in text and Instant Run, it restarts activity! But after modifying some other code, Instant Run works pretty well. Am I missing something?

推荐答案

即时运行在我们的武器库中看起来像是个很棒的工具,请记住,它是Android Studio 2.0的新增功能.仍处于预览"(金丝雀"频道)中,因此可能会有一些问题.正如Google所说,他们计划在未来几个月内对其进行改进.在撰写本文时,支持的内容如下:

Instant Run looks like a great tool in our arsenal, just keep in mind it is a new addition to Android Studio 2.0, which is still in Preview (Canary channel), hence there might be some hiccups. As Google says though, they plan to improve it over the coming months. As of this writing, here's what's supported:

+--------------------------------------+-----------------------------------------+
|           Code Change                |         Instant Run Support             |
+--------------------------------------+-----------------------------------------+
| Change instance method implementation| Supported                               |
| Change static method implementation  |                                         |
| Add or remove a class                |                                         |
|--------------------------------------|-----------------------------------------|
| Add, remove, or change               | Supported but requires an Activity      |
| a string resource                    | restart.                                |
+--------------------------------------+-----------------------------------------+

并且此处是一些即时更改(目前没有)的代码更改支持:

And here are some code changes that Instant Run does not currently support:

  • 添加/删除/更改注释
  • 添加/删除/更改实例字段
  • 添加/删除/更改静态字段
  • 添加/删除静态方法签名
  • 更改静态方法签名
  • 添加/删除实例方法
  • 更改实例方法签名
  • 更改哪个父类 当前类继承自
  • 更改已实现接口的列表
  • 更改类的静态初始值设定项
  • Add/remove/change annotations
  • Add/remove/change an instance field
  • Add/remove/change a static field
  • Add/remove a static method signature
  • Change a static method signature
  • Add/remove an instance method
  • Change an instance method signature
  • Changing which parent class the current class inherits from
  • Change the list of implemented interfaces
  • Changing static initializer of a class

我在测试Instant Run方面也有类似的经验,但这在现阶段是可以预期的.嘿,它甚至在Android Dev Summit上对于戴夫·伯克(Dave Burke)都没工作好几次;)

I've had similar experience testing Instant Run, but this is to be expected at this stage. Hey, it didn't even work few times for Dave Burke during Android Dev Summit ;)

这篇关于Android Studio 2.0即时运行无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆