Wheh building android platform code system hangs - android

Am trying to build AOSP code. Following the instruction am able to start the build but after few minutes my system hangs .System has 3GB RAM and 320GB hdd.

I have a 3GB RAM ubuntu system and AOSP source compiles without problems. Try using
make -j4
This will spawn 4 threads and will compile faster on a multi-core CPU.

it will not compile ..requires about 6 gig ram or more..trust me I use to build on 3gig machines sometime ago.. stop doing it about 1.5 years ago due changing requirements of needed ram.
The good news is that most economy machines you see in walmart now for about $300 to $500 can in fact build AOSP code even though they may have only 8 12 gig ram.

It looks like you may need additional RAM to compile AOSP code. Although it may build with 6 GB, I recommend at least 8 GB; without the extra gigabytes, bad things could happen.

Related

Is it possible to develop Android Applications without an IDE and with a very low grade laptop?

This question has been asked before but I cannot seem to find either YES or NO.
I am fairly a noob when it comes to app development and I can only work with Pascal, and Delphi 2010 is the only IDE my laptop can run without trouble. I have a Compaq CQ58 notebook pc, wth a Intel(R) celeron(R) 1000M # 1.8 GHz processor 64 bit os and 2 GB RAM.
It is a very low grade laptop, but is it still possible to develop android apps with it? I have Kotlin's IntelliJ IDEA Educational Edition 2021.2.1 insalled but it takes up too much RAM with the Gradle plugin running.
To sum it all up, can an Android app be developed Without an IDE and if so, HOW?
Without an IDE? Yes. You can use command line gradle commands to compile, and any text editor to write the files- vi or notepad would work. With that low a grade laptop? Gradle is memory hungry. I wouldn't want to compile a non-trivial app on less than 16 GB, and I prefer 32 or 64. The speed of your processor is actually less important than being able to hold enough data in memory for gradle to run.
I don't know where you are in the world, but you can get a cheap PC for only a few hundred dollars. If you can possibly afford it, its well worth the investment. Even if you could build on your laptop, builds would take hours as things paged. 2GB has been the minimum settings for most OS for a decade, and it didn't run well in that. You can get a 16 GB machine, which I would consider the minimum, for $500 or less. You don't need a good video card or the fastest processor, but you do need sufficient ram.

Android Studio consumes huge amount RAM

I have MacBook Pro 15 with 16 GB Ram. I am just running one project in AndroidStudio and it takes about 6 GB of RAM and make my MacBook slow. This is insane something is terribly wrong with AndroidStudio 3.0.
Please look at the screenshot it has two instances of java taking nearly 3.5 GB of RAM without emulator.
Is there a solution for this issue? I know about this https://developer.android.com/studio/intro/studio-config.html#low_memory but I have 16 GB RAM it should take care of things smoothly without tweaks.
For some reason, Apple limited the RAM capacity of MacBook to 16 GB and Android consumes most of it which is making me frustrated because I can't upgrade the stupid RAM or fix Android Studio memory problem.
For MacOS:
You can use ulimit buildin shell command to limit the use of system-wide resources
You can learn more about ulimit command here
For Windows:
You can check this
p.s: Similar problem was discussed over here

Android Studio is incredibly slow and laggy

Android Studio is painfully slow. It's not just the Gradle build times (which I have seen reach 40+ minutes before I cancelled), it's the whole IDE and my whole computer slows down when AS is open. When I click anywhere in AS, whether it's inside the code or menu items or anything else, it takes seconds to respond.
I uninstalled Eclipse because it was too buggy. AS isn't as buggy but it's way too slow.
Here is what I have tried so far:
Made sure I'm not in presentation mode
Tried both having Compile independent modules in parallel ticked and unticked - slow on both
Changed vmoptions to have -Xmx2048m -XX:MaxPermSize=1024
Ticked Make project automatically
Ticked Use in-process building
Ticked Configure on demand
Ticked Offline work in Gradle
Added --offline in Command-line Options
Added Thumbs.db in "Ignore files and folders" (Editor -> File Types)
Added org.gradle.jvmargs=-Xmx2048m, org.gradle.daemon=true and org.gradle.parallel=true to gradle.properties
Made sure I'm adding only the google play services libraries that I need
None of these solutions helped so how do I fix this? Please don't link a post if it just has things I've tried above.
Like karun already said, an i3 is definitely too low powered to run Android Studio. I'd recommend at least an i7 2ghz or faster, paired with a pure ssd storage (spinning disks are horribly slow in comparison). 8gb RAM is the absolute minimum, 16gb or even more would be better. Android Studio is a heavy-wight IDE and it uses a lot of memory, especially when running gradle in parallel mode.
With such a setup, it still doesn't feel what I would call "fast", but it's OK, regarding all the tasks going on at the same time.
If you want to keep the i3, then the best you can do is to equip it with as much RAM as possible. Also replace your disc (if it's a spinning one) by a fast ssd drive.
This is not a solution, but i think i3 processors are not much powerful to run Android studio smoothly. I had i5 processor and 4GB ram, and I couldn't run chrome and android studio simultaneously with ease but now I've upgraded my ram to 8GB, which helps a lot, still the laptop freezes a bit when the gradle files are being built but other times every thing runs smoothly.
Did you also check -Xms2048m in vmOptions?
This affects the initial ram your android studio takes from the system when loading. The other setting you have (-Xmx2048m) affects the maximum ram android studio can get.
Also setting (-XX:ReservedCodeCacheSize=1024m) helps.
I have a few things for you to try out:
Try an older version of android studio.(If the only thing you want is performance).
Try using a physical device instead of a virtual machine.
Try using a lighter operating system (like lubuntu 18.04). Windows on my computer takes 1 gb when idle while lubuntu takes 1.2 gb when android studio is running
If none of the above work you should consider upgrading your computer.
I personally use a core 2 duo E8400(2 cores,2.83 ghz) with Lubuntu 18.04 and 2 gb ram and android studio 2.3.2 (my computer is so old that is why :)) and it runs flawlessly but you have a core i3 and 4 gb ram which can run higher versions.
NOTE: If you are using Kotlin DO NOT use android studio 2! it does not have support for Kotlin if you use java or c++ go ahead (although you may give up some features.).

Android Kernel Compilation Requirement

I'm trying to setup the environment for Android compilation and the requirements suggest that I need to have 16GB of RAM/SWAP for compiling Android on a virtual machine.
I'm using an Lenovo R430 and it has a 4GB RAM. Can I go ahead with the compilation.
You answered your own question, you have 4gb of ram and you said it needs a minimum of 16gb, now you can add like 20gb of swap, however it will be extremely slow.

Android 4 ICS build source code - minimum system requirements

I have downloaded Android 4.0.1_r1 source. Upon decompressing the tar, the entire source code is around 9.21 GB in the disk.
The guideline in Google as quoted in http://source.android.com/source/initializing.html
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 90GB (or more) for a full set of builds.
Background Info
(my system) -
Intel i5 2 processors (4 core) , 8 GB RAM
My host system is Windows Server 2008 and I am trying to run Ubuntu 11.01 (64 bit) desktop with a memory 4GB allocated as Virtual Machine using Oracle Virtual Box. The disk space in the VM is currently around 50 GB.
These are my few small questions :-
What is the difference between single build and "full set" of builds ?
Based on the configuration shared , is it advised for me build Android 4 on a Ubuntu VM or should I consider installing Ubuntu on a separate primary partition with dual boot and start the build on a Ubuntu Host ?
Are there any known recommended minimum system configuration to support building Android 4 or above as I have seen somewhere in the external forums that one requires 16 gigs of RAM to build android. I dont expect an exact to the point answer on this but some minimum quick pointers would do fine for me based on someone's past build experience with Android 4 ICS.
Although it may appear as a duplicate question here , but the old question refers to previous versions of Android with much less source code.
By single build / full set I guess they mean all the variants you can build (engineering build, userdebug, user, etc).
RAM is a pretty serious issue when it comes to build time. Having said that, I've built ICS on a quad core (Intel Core 2 IIRC) with 4 GB RAM. It would take a couple of hours to build a single variant from scratch (with make -j4), and the computer would be pretty much unusable for other tasks in the meantime.
I think an eight core CPU and 16 GB RAM is about as low as I'd want to go on the specifications if I was going to build Android on a regular basis (I'm currently using an eight core Xeon with 20 GB RAM, which has pretty decent build times).
The disk space usage for the full repo with a single variant built is slightly more than 30 GB for me, but that will depend on exactly what you include in your build, so the 25 GB figure you mentioned doesn't sound unreasonable.
you will be very low on disk rapidely.
you're configuration is OK but it will be slow and you'll need lots of time to compile
Running it on a real ubuntu will give you much better perf
Ram issue is not a real one, if you're system is able to use lots of RAM it will compile faster because it will need less disk access, but doing it with 4 gB can do the thing. just more slowly
For the full set of build part I do not know
Good luck

Categories

Resources