When I ran a program with Android studio today, I suddenly reported a mistake I'd never seen before:
Then I clean and build, the results are not good, the program is still an error, I consulted the great god around, the result has not seen this wonderful situation, and finally through the online solution and its own summary, is a set of perfect solution.
Error reason, code coding format error, we usually use UTF-8 format, the reason for this error, because the encoding format into the Utf-8+bom format, and previously we write the Android program is written in Eclipse, Eclipse can automatically put utf-8+ The BOM format is converted to UTF-8 format, and Android Studio does not have this functionality. So this kind of mistake is not common.
First: Open the Android studio settings, the encoding format is all set to UTF-8 format, now you can try whether also reported wrong, my result is still not resolved.
Second, we need Third-party software, where we use EditPlus to demonstrate the solution. After installing EditPlus, open the software, then open the error in the Java file, in the menu bar click Document Command, select File Encoding--convert Encoding, as shown:
The Convert Encoding dialog box pops up and we can see that the encoding format is Utf-8+bom, and then we'll change it to UFT-8, as shown in figure:
Go to Android Studio and run the program, no more errors.