Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work-around for Inspector: The embedded browser failed to load #5853

Closed
politebarista opened this issue Nov 5, 2021 · 5 comments · Fixed by #5863
Closed

Work-around for Inspector: The embedded browser failed to load #5853

politebarista opened this issue Nov 5, 2021 · 5 comments · Fixed by #5863

Comments

@politebarista
Copy link

politebarista commented Nov 5, 2021

Hi. When I try to view the Flutter Inspector I get the error "The embedded browser failed to load". The processor I use is an Apple M1.
Thank you for your reply.

Version info

flutter doctor -v [✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-arm, locale en-RU) • Flutter version 2.5.3 at /Users/user/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 18116933e7 (3 weeks ago), 2021-10-15 10:46:35 -0700 • Engine revision d3ea636dc5 • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
• CocoaPods version 1.11.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• 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
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.61.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.27.0

[✓] Connected device (2 available)
• sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

Android Studio Plugin versions
@tallinn1960
Copy link

tallinn1960 commented Nov 7, 2021

There seems to be an issue with the JxBrowser the flutter plugin is using: it is delivered with the wrong jxbrowser-mac-7.19.jar on M1. Note that you may need flutter plugin 62.0.3 to have JxBrowser 7.19. Earlier versions of JxBrowser lack M1-support.

I found a workaround for Intellij IDEA: I obtained the JxBrowser 7.19 distribution from

https://jxbrowser-support.teamdev.com/release-notes/2021/v7-19.html

extracted it, und moved the jxbrowser-mac-arm-7.19.jar to

~/Library/Application Support/JetBrains/IntelliJIdea2021.2/plugins/flutter-intellij/jxbrowser/jxbrowser-mac-7.19.jar

(note the renaming). After a restart of Intellij IDEA and launching a flutter app on the simulator the flutter inspector window works as intended.

This workaround will break with every new flutter plugin release that is using a different version of jxbrowser until this is fixed.

I checked with Android Studio that the flutter plugin 62.0.1 uses jxbrowser 7.19 as well. So replacing the jar in the plugin directory of Android Studio may work as well.

@politebarista
Copy link
Author

politebarista commented Nov 8, 2021

@tallinn1960, didn't work for me)
But I have no jetBrains/plugins folder, I have androidStudio/plugins.

@tallinn1960
Copy link

I tried it on your setup and it worked for me.

The flutter-intellij plugin directory for Android Studio is

~/Library/Application Support/Google/AndroidStudio2020.3/plugins/flutter-intellij

Just do as described for Intellij in the jxbrowser sub-directory there: replace jxbrowser-mac-7.19.jar with the ARM version.

@politebarista
Copy link
Author

Reading and didn't even notice your - note the renaming. Sorry, your method helped) Thank you)

@stevemessick
Copy link
Member

@tallinn1960 Thanks for tracking this down! We'll publish an update to automate your fix soon.

Quick summary of the work-around:

  • Obtain jxbrowser-mac-arm-7.19.jar from the JxBrowser distribution
  • Rename it to jxbrowser-mac-7.19.jar
  • Find the jxbrowser-mac-7.19.jar file that was downloaded by IntelliJ or Android Studio
  • Replace it with the newly-renamed file
  • Restart the IDE

@stevemessick stevemessick added this to the M63 milestone Nov 8, 2021
@stevemessick stevemessick changed the title Flutter Inspector - The embedded browser failed to load Work-around for Inspector: The embedded browser failed to load Nov 8, 2021
stevemessick added a commit that referenced this issue Nov 18, 2021
stevemessick added a commit that referenced this issue Nov 19, 2021
* Update build; fix #5853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants