Solve the problem: Android Studio cannot start

1. The previous operation cannot be started:

The build error messages were all garbled, so I searched online and went to the menu Help > Edit Custom VM options.

At this time, AS opens the file bin/studio64.exe.vmoptions in the AS installation directory.

Add a sentence based on what is said online

-Dfile.encoding=UTF-8

That’s it, so I added it, but AS crashed.

It won't start anymore, not even after restarting the computer, nor even after reinstalling.

It seems that sometimes you should not trust online operations. How to solve the garbled code problem, see step 4.

2. Solution

C:\Users\yourUserName\AppData\Roaming\Google

Just delete folders such as AndroidStudio2022.3 under this folder.

3. Possible reasons

studio64.exe.vmoptions is a read-only file. After opening it in AS, you may only see one line because you don’t have permission.

# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
In fact, if you open it with editplus, you will see that there are many lines.

When adding the encoding line of configuration to the AS, because the AS did not have permissions and it did not handle the lack of permissions, it crashed.

4. Solve the garbled code problem

Copy the file bin/studio64.exe.vmoptions. After modifying it outside, copy it to bin/. Windows will prompt you to copy it as an administrator. Just confirm.

Guess you like

Origin blog.csdn.net/piggy514/article/details/133621244
Recommended