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
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.
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.
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:
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.
Related
I've recently started using android studio. When I reopen my project the design is totally blank and component tree shows nothing to show. Even after this app is running perfectly fine when I run it in my smartphone. Render problem
String index out of range
Click on the highlighted area to see what's wrong.
select 'File > Invalidate Caches / Restart'
I am new in Android Studio. I am using Android Emulator for call rest API for my backend. Before, i scroll down basicly in main android page. But after i wanted to tried scroll down, as if i right clicked, Home Setting, Widgets and Wallpaper pop-up show me. What is the solution about that. I never changed any setting.
Thanks for reply.
It looks like your emulator is frozen. It happens quite often.
I would suggest you to try these:
Restart your computer and try to run your app in the emulator. After it successfully runs, now try to clear the app cache.
If that didn't help, create another emulator. I recommend to choose different device and API level than the current emulator device but it is not necessary. This should solve your problem.
Tips
If you want to clear data, clear cache, uninstall app, clear cache and restart the app and so many such actions from android studio without touching your emulator then you can use ADB Idea plugin.
For that, in android studio go to Settings -> Plugins
search for ADB Idea in marketplace. Install it.
You need to restart android studio.
To use it:
You can press shift key in your keyboard twice and search for Adb in search window. You will get all the options from the plugin
From android studio menu... Tools -> ADB Idea and then you will see all the options available.
This is my keymap config in Android Studio. I used to use Command+Alt+L to reformat code after I write a bunch of code and it has been a habit of mine. But this shortcut is no longer working, the Show Reformat File Dialog(Alt+Shift+Command+L) works!
This shortcut is so important to me and I don't want to change it to something else, any idea?
PS: I have an external keyboard plugged in to my Mac when I'm at home. Last time this happens was when I'm using the external keyboard, so I unplugged the external keyboard, not fixed, and then I restarted Android Studio, not fixed, then I rebooted the system, worked. This time I rebooted the system, not fixed, invalidated cache and restarted, still not working. I tried to remove the shortcut and add them back, but I'm not able to add shortcut with Alt and Command both pressed, I can add Alt+L and Command+L, but not Alt+Command+L, so I gave up. Then I changed the keymap setting to something else like Eclipse's and change it back to Mac OS X 10.5+, not fixed... The last option I will try now is to uninstall the AS and reinstall it.
I made changes to an app, just changing the icons. That worked, I was able to see the results when I launched the emulator.
I tried to create a new app but when I launched the emulator again I saw my previous app. I have tried to wipe the user data but it doesn't change anything.
Edit: I saw my previous app but the new app didn't appear.
I eventually deleted the projects, the source code and then restarting eclipse but I'm still having the problems. When I launch the virtual device again it's still showing the original app. I've also tried creating a new emulator as well but I have the same .
Anyone else having this problem or know what's going on?
P.S I also tried loading the Halo theme but it doesn't load.
(Using Mac OS X Lion & Eclipse Classic 3.7 (32 bit))
Did you change the name of your applicaition package to cause this behaviour?
Just uninstall the old app from the emulator.
Menu -> Settings -> Applications -> YourApp -> Uninstall
I'm coming from Visual studio and C# and am new to Android (and eclipse) so quite ignorant of basic functionality.
I've written a short app and ran it under the emulator. No problems.
Now I've made some changes and want to test them. In VS I'd stop the application debug run before making code changes, and after the code changes run again.
I can't find the 'stop' debug button in eclipse. How do I run my app after I've made changes?
What you can do is press the [Escape] key on your keyboard or the 'Back' button within the Emulator to close your app then rebuild and run it in Eclipse, which should bring it up as active in the Emulator.
You can just run it again and the code changes will apply.
But else you'll find it under the Debug-window (Window->Show View->Debug) and there is a "terminate" button in the top right corner of your screen.
You might need to close the app inside the emulator though..
There is deference between just running the application and debugging, you can pres play in ellipse and that will run the app but what you can also do is to switch the perspective in debug view (to switch go to the right top corner, and change from java to debug perspective)
in debug mode you can also set break points, just like in visual studio the only difference here is you must change perspective