Android N requires the IDE to be running with Java 1.8 or later?

后端 未结 17 1423
无人共我
无人共我 2020-11-27 10:58

My XML layout is not rendering with this error message. I am already using Java 8.

Also using latest build tools in Gradle.

and         


        
17条回答
  •  隐瞒了意图╮
    2020-11-27 11:42

    I got the same error you describe but on OS X. I know this may not solve your problem (because I don't know the equivalent for Windows), but since this is not OS specific I am leaving the solution for any OS X fellow out there. Edit the file /Applications/Android\ Studio.app/Contents/Info.plist, and remove the 1.6 version (in my case), you may place 1.6+, 1.7+ or 1.8, whichever you prefer. Mine ended up like this

    ...
    JVMVersion
    1.7+
    ...
    

    Be aware there's an incompatibility with drag and drop with java versions 1.8_60 to 1.8_75 (IDEA-146691) which the IDE will report once you successfully change the version.

    For non Terminal Users

    1. Find your Android Studio.app file. If it's in the dock you can right click it and choose Options > Show in Finder.
    2. Right click it and choose Show package content.
    3. Navigate to the mentioned file (Contents/Info.plist).
    4. Edit the file with your favorite text editor.

提交回复
热议问题