I accidentally ran my Android Studio project on an emulator (for a different device) instead of my real device (forgotten I unplugged it), and the whole computer froze/ran out of memory. No big deal I thought, I turned off my computer and started it again.
However, now when I start Android Studio, I run into problems. It first says indexing for a very long time (like 10 minutes+), then it goes to Building symbols also for 10 minutes+, until it warns me about low memory and eventually runs out of memory.
The out-of-memory error window gave me the opportunity to increase the memory limit and I tried increase the memory field to 2000 (from 1200 something), and that is where I am now, still building symbols 20 minutes later.
Edit: Now it ran out of memory again.
Note that before, when I start Android Studio, everything was set up
within minutes
What should I do? Do I have to reinstall Android Studio? Should I change these memory settings to something else, or clean up Android Studio settings somehow?
What finally worked for me was downloading version 3.2 of Android Studio (if I download via Ubuntu Software it is version 3.3), installing to a different directory and reinstalling the sdk to a different directory. Not sure what part of that was the solution, but anyway, if anyway has the same problem they can try this.
Try going to File then Invalidate Caches / Restart
Try going to C:\users\.android\avd and remove all folders. If the issue is related to your emulators, deleting all folders might help.
Related
I am currently developing an Android App. Four days ago I messed up the Git repository I was working with and I decided to create a new Android Studio project and clone the repository inside this new project.
Since then Android Studio freezes like every 2 - 10 Minutes. I even installed Canary 12 for that reason, I tried to remove everything I found regarding Android on my Computer before! Nevertheless, I still get those freezes.
I already set memory to maximum. At the time Android Studio crashes the total memory consumption is not above 50%, so it can't be a memory problem (in my opinion) - any ideas?
I would try File > Invalidate cache and restart, maybe disable all non included extensions. if that does not work try restarting your computer and/or reinstall android studio.
I am trying to start development on an Android app using Android Studio, but whenever I try to run the app I get the error Unable to obtain result of 'adb version' I have tried uninstalling and reinstalling Android Studio multiple times on different computers (both running Windows 10) and every time I get the same error. I have researched the problem and have been unable to find a consistent solution. (or one that actually works) I am very new to Android development and am slightly at a loss as to what to do; any help on solving this problem would be much appreciated.
Found the solution thanks to #user3109468, Android Studio had the directory for the Android SDK wrong. In File>Project Structure make sure the directory for the SDK is correct; mine was C:\Users\[user]\AppData\Local\Android\sdk (Google had given sdk a capital "S" for some reason...)
Uncheck: enable adb integration from Tools>Android and re-enable it.
This worked for me.
This might be because of windows virtual memory problem.
Try running adb from command line. something like
adb version BTW, platform-tools would be located in
c:\Users\<your userid>\AppData\Local\Android\sdk\platform-tools
How much it takes from you firing a command and actually gets an answer ?
if it takes more than 5 seconds, then android studio times out waiting for an answer and throws up an error.
How to fix ?
close all your program ( Process ? )
and go to control panel -> System->advance System settings-> Advanced tab->performance->settings->Advance->Virtual memory change
Try to reduce virtual memory size. Fr e.g. If it's 4096Mb make it 2048Mb ( both initial and maximum) It will ask to restart, so restart and get yourself a cup of coffee, because it will take a while. Then, once your system is up , try running adb version. Does it run quickly ? If yes, problem is fixed. Go back to virtual memory and increase it's size to the one before, and that's it.
BTW, I noticed in my case that simple hello world program was taking 20 sec to execute on my machine before fixing virtual memory problem.
Make sure Android SDK location and Android NDK location is correct.
Go to File -> Project Structure.
Set the Android SDK location and Android NDK location.
I have just updated Xamarin in Visual Studio 2015 (it was a suggested update from Visual Studio).
After the update, when I start debugging with the emulator AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19), the following error occurs:
The "InstallPackageAssemblies" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InsufficientSpaceException: There is not enough storage space on the device to store package: /data/local/tmp/Mono.Android.Platform.ApiLevel_23.apk. Free up some space or use an SD card and try again.
This did not occur just minutes before the update, and the project remained untouched during the update. I am quite sure about that.
The Xamarin documentation has this error documented here, and says:
There is not enough storage space on the device to deploy the package
This occurs when you don't start the emulator from within Visual Studio. When starting the emulator outside of Visual Studio, you need to pass the -partition-size 512 options, e.g.
emulator -partition-size 512 -avd MonoDroid
But I did start the emulator from within Visual Studio.
Check the internal storage size and available storage of your emulator. Default configuration is often not very large.
On MAC if your getting error make sure you increase your dataPartition to 1024M
disk.dataPartition.size : 1024M
On Mac current config: Feel free to add more bytes if you have a better potato(MacBook pro) than mine
Emulator memory issue
increase heap size ( make it 2*x).
in my case before it was 256 , then after i made it 512 , now its working fine.
posted by venkat Yanamandala
Cobus answer didn't help for me. Checking the device's storage, I saw that there should be more than enough space left to deploy my app. My only solution so far is to create new device in the emulator every time this happens. It keeps happening after I deployed my app several times (like 50+ deploys).
I just clean solution and rebuild again it.
I encountered with the same issue and managed to resolve it by simply uninstall the previous versions from ADB emulator. To uninstall:
.run the emulator.
.Drag&Drop the application's icon to the trash.
These following steps work for me
Increase Data diskpartition size 1024MB
Clean and rebuild again
I solved this question by cleaning the android system cache, there are several tools in the playstore for it, im my case i was debbuging with a attached device, so there was nothing to do with the emulator settings.
Android Studio not executes the IDE, it only shows the splash screen, after few seconds, it dissapears.
I tried the following solutions:
I uninstalled the program and installed again
I restarted my PC after installation
I added "JAVA_HOME" and "JDK_HOME" as environment variables
I checked if "studio.exe" process is executing, if IDE is executing in background.
I executed Android Studio as "Administrator"
I disabled Antivirus temporarily
I deleted ".android", ".AndroidStudio", ".gradle", ... folders
These solutions not worked.
Which is the problem with execution?
If you have done this:
do you have installed the JAVA SDK donwload the latest release from here!
be sure to have configured the JAVA_HOME and JDK_HOME in your environmet variables.
then check the .log file generated by Android Studio to get more information about your issue:
C:\Users[MyUser].AndroidStudio1.2\system\log\idea.log
I recently experienced this issue as well.
It was related to me having dual monitors and oddly the secondary screen was not able to load android studio.
In my setup the issue resolved itself once the secondary screen was made the primary screen ( I have an ATI graphic card 8300) with Android Studio 2.3 and Canary build 3.x
This is typicaly a low memory problem. I currently have the same and I was able to make few correlations. If you start your task manager, you will notice that "Disk" goes to ceiling when starting Android Studio. Actually, you will surely notice that it goes more often to 100% that you'd expect and Android Studio is just the perfect vector to observe this, since it consumes a lot of resources.
The annoying part of the answer is that this "Disk 100%" bug on windows 8.1 is really widespread and solutions doesn't seem that straightforward. For the record, if I find my cause (or if I'm all wrong in my hypothesis), I'll keep you posted.
Regards
My application has a bunch of external .jars, android libraries, and a plenty of code. Bulding the project (I am using eclipse) is terrible. It takes few minutes to do clean/build. And after each rebuild I have to restart eclipse, otherwise it just hangs on second build. I am afraid that soon I'll not be able to build it at all!! Giving more memory to Eclipse has no effect.
On the other side, there is absolutely no problems building small android applications.
I am on Windows Vista, eclipse-java-galileo-SR2, Android SDK Tools (revision8), Core 2 Duo 2GHz.
Q: It would be great to hear from other developers having pretty big projects, if you have same issues, and how you solve them?
An other issue that I see, is that compilation hangs some times since it can't communicate with emulator. If I close emulator, it may complete.
I added more physical memory. Running eclipse with such parameters:
eclipse.exe -vmargs -Xmx700M
Now I have more than enought of memory. It is ~1Gb of extra free RAM available.
Project rebuild takes ~1m 10s, that is about twice faster than it used to be, but on the other side this is still not ideal.
An other positive effect - I don't have to restart eclipse after each rebuild any more.