flutter-intellij: java.lang.IllegalStateException: JCEF is not supported in this env or failed to initialize
What happened
Trying to load Flutter Inspector in Android Studio on Ubuntu 23.04
Version information
Android Studio Giraffe | 2022.3.1 Patch 2 • Flutter plugin io.flutter 76.1.2 • Dart plugin 223.8977
Flutter 3.13.8 • channel stable • https://github.com/flutter/flutter.git Framework • revision 6c4930c4ac (7 days ago) • 2023-10-18 10:57:55 -0500 Engine • revision 767d8c75e8 Tools • Dart 3.1.4 • DevTools 2.25.0
Exception
null
java.lang.IllegalStateException: JCEF is not supported in this env or failed to initialize
at com.intellij.ui.jcef.JBCefApp.getInstance(JBCefApp.java:250)
at com.intellij.ui.jcef.JBCefBrowserBase.lambda$new$3(JBCefBrowserBase.java:152)
at com.intellij.util.ObjectUtils.notNull(ObjectUtils.java:124)
at com.intellij.ui.jcef.JBCefBrowserBase.<init>(JBCefBrowserBase.java:152)
at com.intellij.ui.jcef.JBCefBrowser.<init>(JBCefBrowser.java:190)
at com.intellij.ui.jcef.JBCefBrowser.<init>(JBCefBrowser.java:150)
at io.flutter.view.EmbeddedJcefBrowserTab.<init>(EmbeddedJcefBrowser.java:23)
at io.flutter.view.EmbeddedJcefBrowser.openEmbeddedTab(EmbeddedJcefBrowser.java:61)
at io.flutter.view.EmbeddedBrowser.openBrowserTabFor(EmbeddedBrowser.java:115)
at io.flutter.view.EmbeddedBrowser.openPanel(EmbeddedBrowser.java:62)
at io.flutter.view.FlutterView.lambda$addBrowserInspectorViewContent$3(FlutterView.java:294)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.flutter.view.FlutterView.lambda$addBrowserInspectorViewContent$4(FlutterView.java:294)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:454)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:74)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:114)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:36)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (3 by maintainers)
I’m seeing this issue on
Flutter plugin 77.1.2andAndroid Studio Hedgehog | 2023.1.1:flutter doctor -v (beta channel)
Here’s what worked for me:
First, update the runtime to one with JCEF following these steps:
Then, if you’re getting this error:
GPU process restarts too many times and seems to be unstable. Try to restart IDE or disable GPU acceleration completely.follow these steps:ide.browser.jcef.sandbox.enableoption in the list and disable itWhy this issue is closed?
JCEF not being supported is due to boot runtime for the IDE using a version of the Java runtime environment that does not have JCEF. We recommend trying the steps here for changing to a JRE that supports JCEF: https://stackoverflow.com/questions/69171807/markdown-editor-and-preview-not-working-in-android-studio
Does that work for your use case? Otherwise the backup option is opening DevTools in a separate browser.
Same on Linux.
`flutter doctor -v`
[✓] Flutter (Channel stable, 3.16.5, on Arch Linux 6.6.8-arch1-1, locale de_DE.UTF-8) • Flutter version 3.16.5 on channel stable at /mnt/Development/flutter/sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 78666c8dc5 (vor 10 Tagen), 2023-12-19 16:14:14 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4) • Android SDK at /mnt/Development/android/sdk • Platform android-34, build-tools 34.0.0-rc4 • Java binary at: /mnt/Development/jetbrains/android-studio/jbr/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.
[✓] Chrome - develop for the web • Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop • clang version 16.0.6 • cmake version 3.28.1 • ninja version 1.11.1 • pkg-config version 2.1.0
[✓] Android Studio (version 2023.1) • Android Studio at /mnt/Development/jetbrains/android-studio • Flutter plugin version 77.1.2 • Dart plugin version 222.4582 • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] IntelliJ IDEA Community Edition (version 2023.3) • IntelliJ at /mnt/Development/jetbrains/intellij-idea-community-edition • Flutter plugin version 77.0.1 • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Ultimate Edition (version 2023.3) • IntelliJ at /mnt/Development/jetbrains/intellij-idea-ultimate • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Connected device (3 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator) • Linux (desktop) • linux • linux-x64 • Arch Linux 6.6.8-arch1-1 • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.129
[✓] Network resources • All expected network resources are available.
• No issues found!
@jwren Can you reopen the issue?
Did that and my emulators stopped working. Had to reset to default again
Same issue
Android Studio Hedgehog | 2023.1.1 Patch 1 Build #AI-231.9392.1.2311.11255304, built on December 27, 2023 Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 13.5 Non-Bundled Plugins: Dart (231.9411) io.flutter (77.1.2)
same for me. the error is still present
The same issue happens on macOS 14.0 (23A344).
looks like an IntelliJ issue in general https://github.com/flutter/flutter-intellij/issues/6857
It’s a pain since JxBrowser requires licensing.