#flutter #android-studio #dart
Вопрос:
Установил Android Studio и flutter sdk (скачал zip и распаковал) на моем Mac. Я создал новый простой проект flutter в приложении Android studio и запустил его. Затем я получил следующее сообщение об ошибке.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
Ответ №1:
cd /Applications/Android Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
flutter doctor -v
Я запустил вышеуказанные команды в терминале, и это решено.