Android Studio 2.1 instant run is not updating the app on the device
I observed an issue with AndroidStudio 2.1. When I run the app with small java code changes, it doesn't update app on the device sometimes. Instead it shows a message
No changes to deploy // (Don't show again)
Am I missing any thing here?
As a work around I do clean build every time in order to reflect the changes in app.
Upgrade Android studio version to 3 or more. this bug is resolved.
This was a bug on version 2.0 instant run and issues were reported check these links
https://code.google.com/p/android/issues/detail?id=199884 https://code.google.com/p/android/issues/detail?id=195062
https://code.google.com/p/android/issues/detail?id=206698
https://code.google.com/p/android/issues/detail?id=209413
https://code.google.com/p/android/issues/detail?id=206627
thing to do would be to disable Instant Run entirely by
Settings > Build, Execution, Deployment > Instant Run > Enable
Instant Run
You can file a bug at this link: Google Issue Tracker
please check this answer https://stackoverflow.com/a/35169716/2826147 to turn it off.
Thats a bug in Android Studio, I noticed it in build 2.0 sometimes it failed to update, so what i do is I rebuild the entire project, one more thing, if you have multidex enabled and your device is not running 5 <it will not work, make sure its disabled and rebuild your project.
I have just noticed that whenever i closed my app and then run it worked. See my post here.
https://stackoverflow.com/a/37357665/5923606
Related
I updated to the new Android Studio version 4.0 and there's an irritating issue I am facing which
I believe is a result of instant run (or whatever the new name of this feature is). Basically on using the Android studio run/play button, the app does not launch on the device sometimes and erratically. It always installs but sometimes fails to launch.
I have had similar issues in the past and simply disabled instant run, however, in Android Studio 4.0 I can't see any option anywhere to disable it. I read somewhere that the feature name is changed but searching for that name also didn't yield any results.
How can I disable instant run in android studio 4.0?
I've faced the same issue and disabling parallel run option in the edit configuration window solved the issue for me.
"Apply Changes" has been introduced in replacement of instant run. Besides the Run green button in Android studio, there is apply change option in android studio 4.
So far I have used instant run without any problem in a Nexus 5 with android 7.
Yesterday I updated Android Studio to stable version 3.3
Since then, Instant Run does not work, I always get the following warning:
Selecting the option to uninstall the previous version, it does not start, because the warning of "error installing the APK"
If I deactivate instant Run everything works perfectly again.
About the code or configuration, nothing has been changed.
Of course, I also manually uninstalled the previous version before the initial compilation.
I have read about it in this forum, but I can not find a solution to this specific problem case.
It happens to someone else? Any solution?
At this point, Im using Android Studio 2.1.2. When I changed the code or without changed the code, the app is always kill and restart the session when I want to run the app.
Run App
So how to run the app without kill and restart the session?
You are wondering about Instant Run facility added in most latest versions of android studio. To use it please Make sure you have up to date Gradle plug-ins and builds because it's not only enough that having latest version of Android studio will support Instant Run it also required all stuff up-to-date so Please first check it out.
To check it out if it is disable follow this steps
1) Go to File -> Settings
2) Go to Build,Execution,Deployment -> Instant Run
By default It is enabled if everything is up to date. If not you can.
Go read this for depth understanding : https://medium.com/google-developers/instant-run-how-does-it-work-294a1633367f#.mqwx46kn6
And what is supported under instant run is given here.
https://stackoverflow.com/a/33905037/5476209
You need the latest Gradle build in your project for the same And also you need to run the same app in your phone so that the patch will be installed and activity will be restarted.
Please not that every time you hit an error in run time the quick launch will get disabled and you will have to rebuild the whole project to Instant run again.
Reference :http://tools.android.com/tech-docs/instant-run
When I install my application in debug mode, and open it for the first time it takes a lot of time (nearly 20-30 seconds). I guess it is due to multi dex enabled. It is happening after updating my Android Studio to version 2.0 and upgrding the android gradle plugin to version '2.0.0'. What is the reason for this behaviour? Is somebody else also facing similar issues?
I have been testing on Moto G3 with android marshmallow.
This happens most of the time because of the prolonged time needed to build the solution. The time needed to build a solution is mostly dependent on the number of libraries you are referencing, and the complexity of your code.
Remember that it is the first time you are building the app, so Android Studio has no record of the solution in its cache, hence it has to build everything from scratch.
Android Studio 2.0 also has the instant run feature, so it takes longer to run the first time, so that you can then debug instantly in the subsequent runs.
Hope this helps :)
I think is because of the new Instant Run feature. The first time takes a lot of time, but after that new changes are visible almost at the same time in your device.
In any case you can disable Instant Run in: File->Settings->Build,Execution,Deployment->Instant Run
There is an issue with multidex and API level 21+, relative to Instant Run. The documentation only mentions it without explanation though.
Instant Run
Settings/Preferences(Mac) → Build, Execution, Deployment → Instant Run and uncheck Instant Run
I was also facing the same problem and finally i fixed this.
note: 1) before generating an apk file unchecked all these option to resolve delay issue from your production build.
2) while you are developing or adding new features then keep it as default setting(instant run) to make development faster.
I hope this will resolve your issue.
I download the latest Android Studio 2.0 from Android Develop Website.
But when I change a line of code and use the "instant run", instead of updating the changes, it prompt me "no changes to deploy".
This will happen on code changes and XML changes.
But when I restart Android Studio, things will works fine for once or twice and then "no changes to deploy" Come again!
I used my old SDK on Android Studio older version.
JDK is 1.7.0
Windows7 64
So, is anyone has this same bug?
A lot of people are having this issue as Instant Run is still quite buggy. The best thing to do would be to disable Instant Run entirely by Preferences > Build, Execution, Deployment > Instant Run > Enable Instant Run
Solved by rebuilding Project (menu Build -> Rebuild project)
This sounds like a bug. It would be super helpful to our team if you can report the bug with specific repro steps so we can investigate. Without your help, it's going to be very difficult for us to track down these problems. We want Instant Run to work for you.
You can file a bug at this link: https://code.google.com/p/android/issues/entry?template=Android%20Studio%20Instant%20Run%20Bug
Also having this issue with Android Studio 2.1. Turning off Instant Run seems to have fixed it, which is unfortunate, but I was wasting more time failing to understand why old code was being run than Instant Run was saving me! Running Ubuntu, so agree not just a Windows bug.
Run TAB next to anroid-monitor, sometimes it shows, no changes to deploy mean changes in code has not been added to your app(this bug has been resolved to a great extent).
Sometimes it runs the new app and when you restart your app it shows the old one(this bug has been resolved, officially declared on android site ).
Solution :
Disable instant run under your project settings(you can face some error while gradle build if you switch from instant-Run to normal one then Try clean option or if still there's an error then you can delete those files at the path shown by the error)
Try to use the latest studio release which has totally improved
instant-run.
Not a solution but as a better workaround I'd prefer to:
Press "Recent Apps"
Simply close my app from the list
Run the app again
This takes less time than Clean and Rebuild.
Update:
Rerun the app also works:
When Instant Run does not works correctly:
As far as I realized, Instant Run works properly when I change my views ids otherwise it does't recognise changes in xml and gives me "No changes to deploy"
I also used clean and rerun app or Cntrl+F5 this fix my problem