I am using a Flutter SDK for building a web application.
In these latter days i am trying to working on Linux, and i ran into a problem: Android Studio do not sees a Chrome in device list.
You can say what Flutter SDK is not properly configured, but no - Flutter seed a chrome device, and also Flutter can run a application in chrome via flutter run -d chrome command.
Has anyone encountered a same problem?
Flutter doctor output:
[urusai#mikhail-pc ka4alka-voting]$ flutter doctor -v
[✓] Flutter (Channel beta, v1.14.6, on Linux, locale ru_RU.UTF-8)
• Flutter version 1.14.6 at /usr/lib/flutter
• Framework revision fabeb2a16f (4 недели назад), 2020-01-28 07:56:51 -0800
• Engine revision c4229bfbba
• Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/urusai/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /opt/google/chrome/google-chrome
[✓] Android Studio (version 3.6)
• Android Studio at /opt/android-studio
• Flutter plugin version 43.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (2 available)
• Chrome • chrome • web-javascript • Google Chrome 80.0.3987.122
• Web Server • web-server • web-javascript • Flutter Tools
• No issues found!
Try launch Android studio via terminal.
if it the case, that Chrome(web) device is shown only when u run it via terminal. This means if u can copy your bash ~/.bashrc environment variable to user wide variable ~/.profile it can be fixed.
Try set up your environment variable in ~/.profile so it the same in ~/.bashrc
Related
I'm trying to code in flutter for Linux platform and flutter depend on https://docs.gtk.org/gtk3/
I have updated my system to (Elementary os) and after updating and install builds tools for flutter for Linux build to get this error
when run flutter run -d linux i get that:
Launching lib/main.dart on Linux in debug mode...
(store_items:6176): Gdk-ERROR **: 10:22:28.017: The program 'store_items' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadFBConfig'.
(Details: serial 244 error_code 167 request_code 152 (GLX) minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Error waiting for a debug connection: The log reader stopped unexpectedly.
Error launching application on Linux.
Exited (sigterm)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.2, on elementary OS 6 Odin 5.11.0-37-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.60.2)
[✓] Connected device (2 available)
flutter doctor -v output:
Flutter (Channel stable, 2.5.2, on elementary OS 6 Odin 5.11.0-37-generic, locale en_US.UTF-8)
• Flutter version 2.5.2 at /home/rasol/DevTools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3595343e20 (4 days ago), 2021-09-30 12:58:18 -0700
• Engine revision 6ac856380f
• Dart version 2.14.3
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /home/rasol/DevTools/Android
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /home/rasol/DevTools/android
• Java binary at: /home/rasol/Apps/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2020.3)
• Android Studio at /home/rasol/Apps/android-studio
• Flutter plugin version 59.0.2
• Dart plugin version 203.8292
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] VS Code (version 1.60.2)
• VS Code at /usr/share/code
• Flutter extension version 3.26.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • elementary OS 6 Odin 5.11.0-37-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.71
• No issues found!
Flutter doctor output:
[✓] Flutter (Channel master, 1.19.0-2.0.pre.193, on Linux, locale pl_PL.UTF-8)
• Flutter version 1.19.0-2.0.pre.193 at /home/michal/android/flutter
• Framework revision fed18fc433 (3 hours ago), 2020-05-29 03:43:01 -0400
• Engine revision 17737e6fd4
• Dart version 2.9.0 (build 2.9.0-11.0.dev 6489a0c68d)
[✓] Android toolchain - develop for Android devices (Android SDK version
29.0.0-rc2)
• Android SDK at /home/michal/Android/Sdk
• Platform android-29, build-tools 29.0.0-rc2
• ANDROID_HOME = /home/michal/Android/Sdk
• Java binary at: /home/michal/android/studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 9.0.1-12
• cmake version 3.16.3
• ninja version 1.10.0
[✓] Android Studio (version 3.6)
• Android Studio at /home/michal/android/studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.45.1)
• VS Code at /usr/share/code
• Flutter extension version 3.8.1
[✓] Connected device (4 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10
(API 29) (emulator)
• Linux • Linux • linux-x64 • Linux
• Web Server • web-server • web-javascript • Flutter
Tools
• Chrome • chrome • web-javascript • Google
Chrome 84.0.4147.21 dev
• No issues found!
My app compiles succesfully and I am able to run it without any issues with flutter run -d Linux. However, that does not work when I try to run directly compiled executable, in this case I'm getting error message:
embedder.cc (781): 'FlutterEngineInitialize' returned 'kInvalidArguments'. Not running in AOT mode but could not resolve the kernel binary.
Failed to start Flutter engine: error 2
Failed to create window.
Command to compile:
flutter build linux
Any suggestion how to get it running as standalone app?
It sounds like you are trying to run the executable that's at the top level of the build output. You need to instead run the copy in the bundle subdirectory of the build directory, which has all the supporting files in the correct relative locations.
Once Linux is further along, details of how to use what's in the build directory will be documented somewhere.
Any suggestion how to get it running as standalone app?
The bundle directory as a whole is the standalone app. If you mean having everything in a single executable file without any supporting files needed, that's not possible.
I'm still new to Flutter and programming. Please be kind. Thank you.
This never happen before. I mean the hot reload and hot restart always works. But this time something strange happen:
The app loads on a real iOS device and all works perfectly there. But Android Studio console shows "Installing and launching" with no end. The print statements doesn't show up. The hot reload and hot restart buttons are disabled as well as the green play button at the top. And when I press the stop button (the red square button) the console shows that its stopped but the app still running on the device.
My device is iPhone 7 Plus running iOS 13.3.1
For the iOS Simulators, the hot reload and hot restart works fine. I don't know if this is related but the slider thumb doesn't move in a simulator but it moves in real iOS device.
Here is my flutter doctor:
[✓] Flutter (Channel dev, v1.13.7, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.13.7 at /Applications/flutter
• Framework revision a3bbdfb23a (3 months ago), 2020-01-03 16:19:11 -0500
• Engine revision eb139936eb
• Dart version 2.8.0 (build 2.8.0-dev.0.0 2f57602411)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Applications/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Applications/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.9.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.42.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.0
[✓] Connected device (4 available)
• iPhone • b3ebbe93864b12b2d78acd5efecf25da9ac75d28 • ios • iOS 13.3.1
• iPhone 11 Pro Max • AAFD9B5B-5E10-40AB-A9D8-75D9DAD5EB3D • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-2 (simulator)
• Chrome • chrome • web-javascript • Google Chrome 80.0.3987.163
• Web Server • web-server • web-javascript • Flutter Tools
• No issues found!
Thank you so much!!! Any help is appreciated!!
Android studio and VS code show me both no devices but flutter doctor shows no issues and the flutter run command runs the app fine
Output in Terminal:
flutter doctor -v
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 3 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/nuggetz/Programme/android/
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/nuggetz/Programme/android/
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
EDIT: when i run in Android Studio Tools > Flutter > flutter doctor I get this output:
/home/nuggetz/Programme/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 4 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Process finished with exit code 0
If the status bar reads No Devices Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed.
The Flutter extension automatically selects the last device connected. However, if you have multiple devices/simulators connected, click device in the status bar to see a pick-list at the top of the screen. Select the device you want to use for running or debugging.
Flutter.dev
just move all sdks from /home/nuggetz/Programme/android/ to /usr/lib/android-sdk
While i can compile and run to an Emulator ... i cannot do so to my hard device .. but have been able to in the past. Since then i have had to reinstall both AS and Intellij and now i get this message when attempting to install on my PixelXL
⣾Error retrieving device properties for ro.product.cpu.abi:
error: insufficient permissions for device
See [http://developer.android.com/tools/device.html] for more information
I have been to the link provided and followed instructions, but still no joy.
Interestingly:
bin $ flutter doctor -v
[✓] Flutter (Channel beta, v0.11.12, on Linux, locale en_AU.UTF-8)
• Flutter version 0.11.12 at /home/jedaa/bin/flutter
• Framework revision 06ec8d3b41 (2 days ago), 2018-11-28 15:56:58 -0800
• Engine revision 72c7a75672
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
⣾Error retrieving device properties for ro.product.cpu.abi:
error: insufficient permissions for device
See [http://developer.android.com/tools/device.html] for more information
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /home/jedaa/bin/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/jedaa/bin/Android/sdk
• Java binary at: /home/jedaa/bin/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] Android Studio (version 3.2)
• Android Studio at /home/jedaa/bin/android-studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at /opt/idea
• Flutter plugin version 31.1.4
• Dart plugin version 183.4733
[✓] VS Code (version 1.29.1)
• VS Code at /usr/share/code
• Flutter extension version 2.21.0
[✓] Connected device (1 available)
• HT69R0205363 • HT69R0205363 • android-arm • Android null (API null)
The doctor says it is connected however the hard devices is not plugged in .. and further
the hard device is a permanent resident of the AS emulator connection panel .. even after removing all devices .. hard and virtual . and rebooting!!??
How can i get rid of the persistent device??