Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.4 seems to be stuck on transformClassesAndResourcesWithR8

Just upgraded to Android Studio 3.4 and am trying to compile my apks for the first time with it. Seems to be stuck forever at:

enter image description here

Shall I give this up as a bad job, or be patient?

like image 219
drmrbrewer Avatar asked Apr 18 '19 21:04

drmrbrewer


2 Answers

No, I gave up after 1 hour (had to force close Android Studio), log out and back in again. I then noted that R8 is enabled by default, so I disabled it as per this and now it's back to normal (using ProGuard rather than R8 though).

EDIT I tried enabling R8 again and this time I got an error message Out of memory: Java heap space, with a suggestion to increase the amount of memory allocated to Gradle by using the following line in gradle.properties:

org.gradle.jvmargs=-Xmx1024m

... and it worked! Seems to compile a lot quicker using R8 compared to Proguard.

like image 123
drmrbrewer Avatar answered Oct 20 '22 07:10

drmrbrewer


Even after having 16GB-RAM/256SSD/Core-i7 configuration, I ran into similar issue while building project in release mode on Android Studio 3.4 version with gradle-5.1.1, but after updating to gradle-5.2.1 all issues gone. Just go to File menu and open the Project Structure dialog to update the version. enter image description here

like image 5
Vikas Patidar Avatar answered Oct 20 '22 07:10

Vikas Patidar