I've been through it too, recently.
Whenever I dragged a new component to activity
android studio
caught, I realized that this was happening because that element was not "off-line" and android studio
was immediately looking for dependencies and adding to the project , but crashed for lack of memory, processing or faith.
To resolve this, I:
- I closed everything that was open, I just left android studio.
- I closed my project and opened a new one with just
empty
activity
.
- I started dragging all the components into this
empty activity
, a
to one, and every time I was dragging I expected the IDE to finish
and download what you needed from the internet, even if it took
few minutes.
After doing this with all the elements, and leaving all available offline, I deleted this test project and returned to mine, the problem stopped happening.
Footnote: You should probably have an option to download all dependencies on some menu or option of gradle
, but it should be very well hidden because I did not find it in my IDE, so I did this gambiarra manually.