Android Studio 2.x - Character Building ... Forever

I have a problem with Android Studio. After upgrading AS to 2.2, it takes a long time (~ 30 minutes) to process, indicating that it is β€œCreating Characters ...” The project is quite large and includes NDK components.

Creating using gradle is pretty fast:

BUILD SUCCESSFUL time: 12.089 secs 

My gradle_wrapper settings:

 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip android.useDeprecatedNdk=true org.gradle.daemon=true org.gradle.parallel=true #android.dexOptions.preDexLibraries=true #android.enableBuildCache=true org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m- HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 

What happened to Android Studio? How can I speed it up?

+7
android studio
source share
1 answer

Try changing the settings of the virtual machine?

Your virtual machine may be running out of memory or you may be under pressure from the memory. You can try to increase the amount of memory available for Android Studio under Help , you can choose Edit Custom VM Options .

 -Xms256m -Xmx8192m -XX:ReservedCodeCacheSize=2048m -XX:+UseCompressedOops -XX:MaxPermSize=4096m 

Delete all .idea directories and re-import the project

Close Android Studio and in the project directory and delete all the .idea folders. On macOS or Linux, which can be executed using the find .

 find . -name .idea -type d -exec rm -rf {} + 

Then launch Android Studio and re-import the project.

Switch to CMake

Support for Android Studio NDK is based on CLion, which uses CMake as the project file format. I found that switching my large project to pure CMake put an end to the Building Symbols problem. This makes sense, as it is probably more thoroughly tested by JetBrains and easier to maintain than Android.mk projects.

+7
source share

All Articles