This happens when I compile, and I run the code from SVN download to report this error.
At that time I also ignorant roar, how may not configure Java_home, run Java-version all show out 1.8.
Later, let colleagues help me to see. He didn't say anything, he didn't hit the ceiling, just to search "Android Studio configuration JDK"
HTTPS://zhidao.baidu.com/question/496702061644253324.html
And then
Just replaced the development environment with Android studio, not familiar with the JDK and the SDK to change the path, looking for a half-day, only to find that this: Click File, select Other Settings, choose Default Project Structure ..., You can see where the JDK and SDK are set up. For your reference.
He opened it, and sure enough it was using the Android Stadio JRE, which was opened after this panel.
Then I changed it into my own JDK and I could run it.
You don't have to copy all the pictures under the drawable.
Attention:
1. Don't feel like you're right about anything in the future. Still so ignorant to think.
The compiler is right. It does not make mistakes for no reason. It's the boss.
Ensure the installed a JDK (not just a JRE) and configured your java_home system variable