Android studio Unable to create classes and interfaces and prompt the perfect solution to the problem

  • 2021-08-31 09:13:02
  • OfStack

This is awkward, what went wrong, according to template error, open file- > setting- > file and templates found that templates inside was all empty, class had no template, so I took a test from others and pasted it. I found that I could build a new class, ok, and the problem was solved.

But after a few days, I found that there was a problem again. I opened studio again and found that templates was empty again. I can't copy it again every time I open IDE

The final solution is as follows:

Open the folder where studio is located (close studio before that),

Find the file studio. exe. vmoptions under the bin folder

Open this file using Notepad

Add the following sentence:

-Djdk.util.zip.ensureTrailingSlash=false

Save, ok, restart studio, open ES40and templates, find that all templates exist, and the problem is solved.

Summarize


Related articles: