invalid gradle jdk configuration found android studio что делать
Не запускается эмулятор в Android Studio (подробности внутри). Как пофиксить?
Вводные: AMD, Win10x64, Android Studio 4.1.1.
Java установлена, в командной строке и в Eclipse работает.
При создании проекта Empty Activity выдает в Sync «Invalid Gradle JDK configuration found» и на выбор 2 варианта: 
Насколько я могу судить по тому, что нагуглил, такая проблема возникает, если в настройках структуры проекта не указана или указана ошибочно SDK. Но и SDK, и JDK указаны корректно, см. нижний спойлер.
Если я выбираю из предложенных вариантов использовать JDK из структуры проекта, то говорит, что «BUILD SUCCESSFUL in 4s», но при попытке запуска эмулятора из AVD бесконечно крутится вот эта фигня: 
Под «бесконечно» я подразумеваю, что спустя время выпадает «Timed out after 300seconds waiting for emulator to come online.», но вращение анимации загрузки не прекращается, и при этом ничего больше не происходит длительное время.
Если же выбираю перейти в настройки gradle, то даже несмотря на их скудность я не понимаю, что именно с ними следует делать, в силу того, что ни разу не сталкивался ни с Gradle, ни с Android, ни с самой IDE. 
Чисто ради эксперимента я пробовал в Use Gradle from прописывать Specified location’ом путь как в Gradle home, но это ничего не изменило.
В Event Log советуют заглянуть в Help | Show Log. Я так и сделал, но значения содержимого не понимаю.
Я искал по-разному и находил разные советы, в т.ч., как мне кажется, совсем не связанные с делом, но тем не менее, от безысходности я уже решил пробовать все подряд методом тыка, если описанная проблема похожа на мою. Что я предпринимал в порядке этих советов, и какие системные параметры проверил на соответствие оным:
Становится ясно, что я где-то не там ищу решение, но моего уровня, видимо, недостаточно, чтобы понять что-то очень простое и банальное, но не очевидное.
Так что именно я делаю не так, и что мне следует предпринять, чтобы таки запустить этот проклятый эмулятор в Android Studio на данной конкретной машине?
Invalid gradle jdk configuration found android studio что делать
When I open a project and report this error,
Looking at the error message, you can roughly know that it is the JDK configuration problem, and then I will check the JDK configuration:
Or just follow the method recommended by netizens:
Modify the parameters here, and then rebuild.
Intelligent Recommendation
Under Ubuntu JDK, SDK, Gradle configuration
JDK, Tomcat, Maven, Gradle environment variable configuration
Android Studio and Gradle use different JDK location of the problem (Android Studioand Gradle are using different locations forthe JDK)
Initial installation of Android Studio, encountered many problems, which is one share, also to seek dalao you look at it ((* ^ __ ^ *)) Use a different JDK position may cause Gradle produce multiple d.
Gradle tutorial (2): Gradle project structure and property configuration
2.1 Declarations (Conventions) Some people translate the word «Conventions» into «conventional», some people translate it into «declarative», I prefer the latter, so I wi.
How to instruct Gradle to use Java from different location?
I was building my test app in Android Studio, then in the Event Log it said:
Android Studio is using this JDK location: C:\Program Files\Android\Android Studio\jre which is different to what Gradle uses by default: C:\Program Files (x86)\Java\jdk1.8.0_181 Using different locations may spawn multiple Gradle daemons if Gradle tasks are run from command line while using Android Studio.
Then gave these options:
Set Android Studio to use the same JDK as Gradle and sync
then my app didn’t want to build any more.
Gradle sync failed: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/5.4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap Consult IDE log for more details (Help | Show Log) (16 s 166 ms)
I checked the event logs:
I think previously it did this:
Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
Instructing gradle to use java from C:/Program Files (x86)/Java/jdk1.8.0_181
How do I set it back to the way it was so my app can build again?
After Android Studio sync my gradle project, I see the following message in the event log:
Android Studio is using this JDK location: /path/to/my/project/specific/jdk which is different to what Gradle uses by default: /path/to/android/studio/embedded/jdk Using different locations may spawn multiple Gradle daemons if Gradle tasks are run from command line while using Android Studio. Set Android Studio to use the same JDK as Gradle and sync project
6 Answers 6
Update
This answer deals with macOS cases. It doesn’t imply Linux or Windows solutions.
TLDR
or, if you want to use your system-defined JDK:
But this only works for the current session of your machine. Next, you have to create a
or, if you want to use your system-defined JDK:
The plist will activate after system reboot. You can also use launchctl load
/Library/LaunchAgents/environment.plist to launch it immediately.
Deeper explanation
I suspected that Android Studio didn’t actually see my JAVA_HOME environment variable, so I inspected the Android Studio process’ environment variables:
Next, I tried launching Android Studio from the terminal:
I started getting this warning after updating to Android studio version 3.6. I was getting below warning:
To fix this warning I changed the project JDK location to Gradle JDK location.
from dropdown select JDK location of your Gradle. In my case it is below location :
Click apply and Ok.
I am using a windows system from microsoft too. To solve the this problem, just follow these simple steps.
Set your JAVA_HOME environnement variable to point to your installed jdk. In my case that was C:\Program Files\Java\jdk-9.0.1
Then, In Android studio, click on Select a JDK from the File System from your Even Log or go to project struture then sdk location.
Set the jdk location as indicate in the above image and click on apply.
I’m running Windows and had the same error when upgrading to AS 3.6.1.
As well as Android projects I also build Java projects on the same machine, both of which use different versions of Java. So pointing AS / Gradle wrapper to my JAVA_HOME is not an option.
To solve the problem I need my environment variable JAVA_HOME to point to my Java projects and JAVA_HOME for AS / Gradle to point to the version of the JRE shipped with AS.
There is a simple solution. Its a bit messy, but it works. To do this you will need to be able to see hidden files. Then mod the Gradle wrapper batch file as follows:
Go to the function:
This isn’t a permanent solution, as it may well be overwritten with new versions of Gradle, however it works for now and hopefully long enough for someone (hopefully Google) to point AS and is Gradle wrappers to the correct location by default.
Неверная конфигурация JDK найдена, при импорте проекта через Gradle
Я установил IntelliJ, и мне нужно импортировать проект Gradle.
Я построил проект gradle с помощью командной строки с помощью команды build.
На приветственной странице IntelliJ я приступил к выполнению правильных инструкций, и когда я выбираю «Готово». Я получаю следующую ошибку:
Неверная конфигурация JDK Gradle. Параметры Open Gradle JANA_HOME не заданы.
Когда я нажимаю «Open Gradle Settings», он появляется с ошибкой «Не найден с дорожкой в каталоге IntelliJ в файлах программы и ищет в jre/jre/bin/. и т.д.».
ОТВЕТЫ
Ответ 1
Просто нашел решение:
Ответ 2
Вам не нужно создавать новый проект, чтобы это исправить. Вы можете сделать это из главного окна (Конфигурировать → Стандартные настройки проекта → Структура проекта):
Затем в SDK просто установите соответствующий JDK home path :
Ответ 3
Решение для Mac OS X:
У меня была такая же проблема и исправлена ее, установив переменную среды JAVA_HOME с помощью команды:
См. Этот ответ о том, как установить переменные среды в Mac OS X: настройка переменных среды в OS X?
Ответ 4
Ответ 5
Ответ 6
У меня была такая же проблема на новой установленной ОС Windows. У меня вообще не было JDK, и я забыл проверить неправильную конфигурацию JDK. По умолчанию вы можете проверить конфигурацию проекта. Если оно пустое, NO_SDK_ProjectStructure попробуйте загрузить JDK с веб-сайта Oracle и настроить структуру своего проекта.



I am using a windows system from microsoft too. To solve the this problem, just follow these simple steps.

