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

后端 未结 17 1368
无人共我
无人共我 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:33

    Make sure you have installed jdk for x64 and not x84 when starting Android Studio (x64)

    0 讨论(0)
  • 2020-11-27 11:34

    Set JDK_HOME and JAVA_HOME environment variables, in my case C:\Program Files\Java\jdk1.8.0_60.

    Check Java version in Help > About. It should show the JRE version you just set.

    That is it, now you can preview your layout in N.

    0 讨论(0)
  • 2020-11-27 11:34

    I have solved it in these way.(AS+MAC OX El Capitan)

    1. Updating SDK Tools>Android SDK platform tools
    2. Go to Help>Edit Custom Properties> A dialog will prompt(press yes) then write

      JVMVersion=1.8 
      

    Then close Android Studio fully and reload the project

    0 讨论(0)
  • 2020-11-27 11:36

    My issue was that the Android N was "partially installed".

    My solution was to go to - Preferences/Appearances and Behavior/System Settings/Android SDK and check the Status. If it's "partially installed" then you have to uninstall then reinstall. (Uncheck the checkbox and hit apply; it will uninstall; then you can check the box and install it again) Worked for me. If you go to lower version(like 23) then you have to change the buildToolsVersion variable to "23.0.0" in the build.gradle.

    0 讨论(0)
  • 2020-11-27 11:39

    From the docs: https://developer.android.com/studio/intro/studio-config.html#file_location

    STUDIO_JDK: set the JDK with which to run Studio

    I prefer using the STUDIO_JDK variable and leave other default java home variables alone.

    0 讨论(0)
  • 2020-11-27 11:40

    I had faced the same problem. Please make sure that you are rendering the XML layout for the compiled SDK version (Must not be greater) . Means you will face this if you are compiling the code using Targeted SDK version 23 and your trying to render the XML in SDK version 24.

    0 讨论(0)
提交回复
热议问题