1

I am trying to get Instant Run to work in Android Studio. I have A.S. 2.0 Preview 4 installed, and my Instant Run is enabled like this: enter image description here

Now, I am experimenting with this in the Topeka sample app from Google (https://github.com/googlesamples/android-topeka). So, I am placing a bunch of Toasts in CategorySelectionActivity and CategorySelectionFragment, hoping that they can be instantaneously changed with Instant Run. But every time I hit the Instant Run button in A.S., it completely shuts down the app and re-installs it. It does not resume from the same activity I was on previously (as expected), NOR is it displaying the toast message like

Applied code changes without Activity restart

Does anyone know how to get Instant Run to work properly?

Thanks, Igor

4

2 回答 2

1

请将 Android Studio 更新到Android Studio 2.0 Preview 8 .Android Studio 2.0 Preview 8 到 canary 通道,以及新版本的 Gradle 插件:2.0.0-alpha8。您需要同时更新两者;特别是即时运行仅在使用两者的最新版本时启用:

于 2016-01-29T09:50:04.913 回答
0

这个问题的解决方法是将 Android Studio 更新为2.0 Preview 8,gradle wrapper 为:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

并使用此 gradle 依赖项:

classpath 'com.android.tools.build:gradle:2.0.0-alpha8'

即时运行现在可以在我的 Mac 上运行!

于 2016-01-18T16:31:25.613 回答