I am having a good problem with Android Studio. Initially I was using eclipse to develop android App, but eclipse display funny stuffs like deleting all my codes and most times crashes so I decided to try Android Studio.
Now am using android studio, but whenever I open an activity to start typing code, the IDE forcefully shuts down. Initially i tougth this happens when there is an error in your code, because I had an instance where the IDE shut down, was fixed by correcting the errors. But now the codes are all correct and when I install on emulator it installs properly.
But whenever I open an Activity and start to type Android Studio shuts down. I have tried to check for similar question, but could not find anything suitable. Please I need your help because I have a lot of project with deadlines and this AS behaviour is making me run nuts.. Thanks
There might be memory issue with Android Studio. I recommend you to shutdown all the heavy-weight memory consuming application like Chrome etc. to be shutdown.
I hope it will help.
Thanks all I finally got the solution to the shutdown. I had to create all the Activity used from AS and copy the codes into each file created. Initially i copied all the Activities, resources and Manifest I created in eclipse and paste them into AS. I guess AS doesn't perform auto update and this cause it not have have reference of the pasted files in memory making it to crash.
Sometimes some plugins keep running if studio crashes and they consume so much memory that studio is not able to launch again.
Or see if other applications are running and consuming much memory.
Or you can restart the system.
Related
I really need some help with this.
I had to migrate from Eclipse to Android Studio.
I exported my project (at first time - using "export" tool, at the second time manually - same result) and everything worked great (I worked for 2 days successfully) before I tried to make an apk-file. While making an apk-file, AStudio was complaining about some things like "change your customNS to res-auto" and when I did so, it started to freeze. If it freezes it's over, I have to kill the process of AS. When I reload AS, it makes a rebuild and then deadly freezes again. I figured, the build itself doesn't hang the AS, it freezes when I try to interact with source files. Try to print just a single letter - and it's over.
I ran this project on my friend's laptop (it's more powerful than mine) and it doesn't freeze there. But I'm not sure it's really connected with the power of PC.
Please give me some advice. Thanks.
So, problem solved. I had in my file some if-else-if structure with about 50 conditions. Refactoring it solved the freezing problem.
That's probably AStudio's way of punishing those who write bad code :)
I am facing a weird experience with Android studio that during when it suddenly hangs, the previous changes that I made in my project are not saved. This issue happened for me several times when I close the Android studio manually from Task Manager during system crash or when I get Android studio not responding error. This kinda error is not occuring if I save the workspace often through ctrl+s(Save) or ctrl+shift+s (Save All), but these issues I have never faced with Eclipse previously I used for development. So kindly please mentor me whether is there any settings that I have to change or update in my Android studio to resolve this issue. Your solution would help and useful for me to prevent my code from losing the changes I made. Thanks in advance.
Please text me if my question is not clear. Expecting your valuable answers and solutions. I have been facing this issue since I started using Android studio and because of this I have lost lots of data in my code.
Have you allocated the correct amount of ram to the avd? As well as having enough to run studio anyway? Additionally Cpu can be an issue if you're using something like an i3 or low end i5.
I can't run studio on my laptop due to it being generally bad but also the Cpu can't take the load.
My studio's current version is 0.9.9 (recently updated), now here is the history:
There was some problems when I shifted eclipse to studio. The last problem happened when I updated it. My app became full of error. One of them was cannot resolve Symbol ActionbarActivity. And so many others. I spend a day behind it and gave up. I recreated my app from first to last with the same resources, then it became totally good to go. Three days later(today) again another problem raised. I turned on my laptop, opened Android studio and it says Rendering problem No Android SDK found. Please configure an Android SDK. But last night it was running fine. Now there is no design window.
I am wondering that why the errors come automatically. I don't do anythings in the settings stuff of the studio. I just develop my app. I just write code and make my app. So whats wrong with the studio. It crashes without any reason and I have to waste the half of the time. Is this a kind of jokes? It too much irritating. Updating latest version is not the reason. The problem is occurring from whenever I downloaded the Android Studio and shifted from Eclipse to it. With 2 or 3 days intervals it comes with new problem.
I suggest you to try fresh Installation or, As it happens because of some internal Intellij's libraries problem.
During my development under Android I saw that if I don't clean before building and running the application, it will keep some old files giving me no-sense errors since they were fixed one or two runs before.
Have you ever experienced this problem? Any idea of how to prevent it / how to clean always before running the application on Eclipse?
This is not happen always. Most of the time if you not clear the project before build won't harm the application. I clear it form time to time, mostly when I change something in xml files, but for regular app checking I don't think you have to do it and I doubt that there is any method to clear before each build.
I'm having a troubling problem testing some code for and Android app. My app has two parts, and activity where the user changes some settings, and a broadcast receiver that responds to SMS messages, both in the same package.
Here's the problem, I first implemented some simple code to test out the broadcast receiver and the activity, and both worked fine. But then as I tried to refine the code, I noticed the emulator wasn't picking up any of my changes. Event went so far as to uninstall the app from the emulator and try again, no luck. Then I added some extra Toast popups to my receiver, nothing, still running the old code. I know its running the old code because its sending out an SMS using a string constant that is no longer in the current code, so it should be impossible that it respond with that value.
Here's the kicker that has me confused. For fun I made a change to my activity. Ran the project from Eclipse and that change showed up! Tried to test the receiver code again, runs the old code that doesn't even exist anymore!!
How in the world can half the package update, and the other half not?
Can anyone help me out 'cause I'm about ready to lose my mind.
I had a similar problem. Changes made to classes imported from another project didn't get picked up by eclipse, but those made to classes in the current android project were.
Making a change to the current android project (inserting a blank line and deleting it) seemed to make eclipse pick up all the changes made and upload the app to the emulator.
I had this problem too, Now I found a working solution. Just follow these steps:
Run your project normally.
When emulator started, run your project again (DO NOT close the first emulator)
Then the updated application will be uploaded into emulator
I can't really be sure what happened but creating an new emulator image appeared to solve the issue.
I don't know why it happens but it's a problem I have all the time.
What I typically do is
Close the emulator
Close Eclipse
Reopen Eclipse
Clean the projects (in Eclipse, select Project -> Clean... -> Clean all projects)
Rerun the emulator
Annoying as hell but seems to work for me.
I'm having this problem too. It mostly happens when errors are entered into the code. The strange thing is if I go back to the original code, Eclipse doesn't revert to the original code. One thing that seems to help is to temporary delete the contents of a file, save, and rebuild, and then enter the contents back into the file, save, and rebuild.
How is one supposed to debug in such an environment?