Android Studio 2.x - Building Symbols… Forever

前端 未结 2 1972
臣服心动
臣服心动 2021-02-06 00:52

I have problem with Android Studio. After updating AS to 2.2 it takes a long (~30 min) time to process indicating that it is \"Building Symbols...\" The project is reasonably la

相关标签:
2条回答
  • 2021-02-06 01:08

    Try changing the VM options?

    It is possible your VM is running out memory or you're under memory pressure. You can try increasing the amount of memory available to Android Studio under Help you can choose Edit Custom VM Options.

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

    Delete all the .idea directories and re-import the project

    Close Android Studio and in the project directory and delete all .idea folders. On macOS or Linux that might be accomplished with the find command.

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

    Then launch Android Studio and re-import the project.

    Switch to CMake

    Android Studio's NDK support is based upon CLion which uses CMake as its project file format. I found that switching my large project to pure CMake put a permanent end to the Building Symbols problem. It makes sense, since it is probably more thoroughly tested by JetBrains and easier to support than Android.mk projects.

    0 讨论(0)
  • 2021-02-06 01:18

    I solved it, it was maybe caused by a large project size.

    so, if Windows, go to Program Files/Android/Android studio/bin and find studio.exe.vmoptions or studio64.exe.vmoption files (choose 32bit or 64bit)

    Last, change xmx option.

    xmx option may setting 1248m, change it more than 4000 or 6000...(think your build machine ram size)

    Building symbol need larger ram size than default setting.

    0 讨论(0)
提交回复
热议问题