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

Run as a release on Ubuntu 16.04 / libstdc++.so.6 reported missing #6207

Closed
raju-bitter opened this Issue Oct 4, 2016 · 41 comments

Comments

Projects
None yet
@raju-bitter
Contributor

raju-bitter commented Oct 4, 2016

Admin edit: if you are experiencing this issue, please try to install lib32stdc++ using e.g.:

sudo apt-get install lib32stdc++6

Original comment below line


After creating a helloworld project, tried to run the app on Android as a release on Ubuntu. Launching in debug mode worked fine, but when I tried to run as a release, I got an error that 'libstdc++.so.6' is missing.

1) Launching with missing library
raju@titan:~/coding/flutter/helloworld$ flutter run --release --full-restart
Building APK in release mode (android-arm-release)...
Dart snapshot generator failed with exit code 127
/home/raju/dev/flutter/bin/cache/artifacts/engine/android-arm-release/linux-x64/gen_snapshot: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Failed to build AOT snapshot

2) Installing the missing package
raju@titan:/coding/flutter/helloworld$ sudo apt-get install lib32stdc++6
[sudo] password for raju:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
lib32stdc++6
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/404 kB of archives.
After this operation, 1,901 kB of additional disk space will be used.
Selecting previously unselected package lib32stdc++6.
(Reading database ... 253193 files and directories currently installed.)
Preparing to unpack .../lib32stdc++6_5.4.0-6ubuntu1
16.04.2_amd64.deb ...
Unpacking lib32stdc++6 (5.4.0-6ubuntu116.04.2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up lib32stdc++6 (5.4.0-6ubuntu1
16.04.2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

3) Running as release again
raju@titan:~/coding/flutter/helloworld$ flutter run --release --full-restart
Building APK in release mode (android-arm-release)...
Warning: signing the APK using the debug keystore.
Built build/app.apk (8.1MB).
Running lib/main.dart on SM N920S...
--------- beginning of main
Application running.

Solution
The flutter doctor tool could check if the library has been installed, or it could be added to the list of required tools here: https://flutter.io/setup/#system-requirements

Steps to reproduce: System setup and tool installation performed

  1. Install Ubuntu 16.04 using this image
    http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-amd64.iso

  2. Install Flutter following these instructions
    https://flutter.io/setup/#get-the-flutter-sdk
    sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
    sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
    sudo apt-get update
    sudo apt-get install dart

  3. Install Dart SDK for Atom
    https://www.dartlang.org/install/linux

  4. Install Oracle Java and Android Studio with SDK
    a) Java
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt install oracle-java8-installer
    sudo apt install oracle-java8-set-default
    b) Android Studio
    Downloaded deb from website
    Installed Android Nougat SDK

  5. Install Atom
    Downloaded deb file from atom.io
    Installed deb

a) Dart & Flutter for Atom
apm install flutter
apm install dartlang

  1. flutter doctor output now
    raju@ubuntu:~/coding$ flutter doctor
    [✓] Flutter (on Linux, channel master)
    • Flutter at /home/raju/dev/flutter
    • Framework revision 9f673ad (5 hours ago), 2016-10-04 08:20:24
    • Engine revision 27d012a
    • Tools Dart version 1.20.0-dev.5.0

[✓] Android toolchain - develop for Android devices (Android SDK 24.0.3)
• Android SDK at /home/raju/Android/Sdk
• Platform android-24, build-tools 24.0.3
• Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

[✓] Atom - a lightweight development environment for Flutter
• flutter plugin version 0.2.6
• dartlang plugin version 0.6.40

[✓] Connected devices
• SM N920S • 05157df5d93b793d • android-arm

  1. Create new app
    flutter create helloworld
    cd helloworld
    flutter run
@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Oct 4, 2016

@danrubel should we update flutter doctor to check if sky_snapshot can run without errors? Not sure what the best resolution here is. This seems like a linux-specific flutter setup issue, which could either be solved by documentation or tooling, unsure.

@abarth

This comment has been minimized.

Contributor

abarth commented Oct 4, 2016

@chinmaygarde

This comment has been minimized.

Member

chinmaygarde commented Oct 4, 2016

Fortunately, we just switched to using the Fuchsia buildtools. They provide a libcxx and libcxxabi that we can statically link into gen_snapshot. However, this only works for x64 targets right now. gen_snapshot is i386 because it needs to generate armv7 code. I had filed https://fuchsia.atlassian.net/browse/TO-61 to track the issue related to making libcxx available to us on i386 as well. Now that I know there are actual issues with users not having the .so on their system already, I will raise the priority on the same.

A workaround for this issue could be to ensure something like apt-get install libstdc++6 has already been done on Linux hosts (am on Mac right now so that is from memory).

@raju-bitter

This comment has been minimized.

Contributor

raju-bitter commented Oct 5, 2016

sudo apt-get install lib32stdc++6 was the command I had to use on 16.04 64bit.

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Nov 1, 2016

#6040 was another report of this.

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Nov 1, 2016

I think #4916 is another report of this. :/ This is probably something flutter doctor should try to catch, given that we've had 3 reports now. FYI @danrubel

@Hixie Hixie modified the milestone: 3: Make conferences happy Nov 30, 2016

@ethael

This comment has been minimized.

ethael commented Jan 18, 2017

I had the same issue. Debian Sid amd64

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Jan 29, 2017

#6040 was another report of this. So I guess that's 4 reports of this mis-configuration on linux? (That's shockingly high if true.)

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Feb 8, 2017

This would be an easy check to add to flutter doctor. We should just do it.

Probably belongs in:
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/android_workflow.dart
since we don't have a linux-specific setup file at the moment.

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Feb 10, 2017

#8059 looks very similar, but not maybe identical. Clearly there are a bunch of packages flutter doctor could check for on linux which are not installed by default (at least not on 64-bit installs). In #8059 @abarth noted that the Android toolchain requires ability to execute 32-bit binaries for instance.

@mit-mit

This comment has been minimized.

Member

mit-mit commented Feb 28, 2017

Moving to milestone 2; this looks like a very common issue on linux boxes.

@uncleGena

This comment has been minimized.

uncleGena commented Jun 25, 2017

if some body facing this problem
✗ Downloaded executables cannot execute on host (see #6207 for more information)
This is that information -> sudo apt-get install lib32stdc++6
helped on ubuntu 14.04

@jaworanski

This comment has been minimized.

jaworanski commented Feb 28, 2018

@tvpmkc I ran into this issue and it was my antivirus blocking \flutter\bin\cache\artifacts\engine\android-arm-profile\windows-x64\gen_snapshot.exe. Delete the cache folder in \flutter\bin and then run flutter doctor. Check for the exe in the above location, if it’s not there then check your antivirus settings. Hope this helps!

cbracken added a commit to cbracken/flutter that referenced this issue Mar 1, 2018

Improve error message for missing 32-bit libstc++
Adds more actionable error messages for users of the most common Linux
distributions. We could improve this by checking the current
distribution and emitting only the appropriate error message. We could
further improve that by only emitting the install instructions if we
determine the appropriate package is not installed.

See: flutter#6207
@cbracken

This comment has been minimized.

Member

cbracken commented Mar 1, 2018

In #15004 I've added instructions for Debian/Ubuntu/Mint/Fedora/Arch to the doctor error message.

cbracken added a commit that referenced this issue Mar 1, 2018

Improve error message for missing 32-bit libstc++ (#15004)
Adds more actionable error messages for users of the most common Linux
distributions. We could improve this by checking the current
distribution and emitting only the appropriate error message. We could
further improve that by only emitting the install instructions if we
determine the appropriate package is not installed.

See: #6207
@tvpmkc

This comment has been minimized.

tvpmkc commented Mar 1, 2018

@jaworanski Spot on. That was the issue. Anti virus was quarantining the exe automatically. It's working now. Thank you!

@jlelse

This comment has been minimized.

jlelse commented Mar 3, 2018

Just for other Solus users, this fixed it for me:

sudo eopkg it libgcc-32bit libstdc++-32bit

@0x68

This comment has been minimized.

0x68 commented Mar 4, 2018

Solution for Fedora 26/27

sudo dnf install libstdc++.i686

@idecipher01

This comment has been minimized.

idecipher01 commented Mar 8, 2018

Getting error in Debian (Kali linux) when running flutter doctor,

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel beta, v0.1.5, on Linux, locale en_IN)
✗ Downloaded executables cannot execute on host (see #6207 for more information)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[!] IntelliJ IDEA Ultimate Edition (version 2017.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected devices
! No devices available

@Sprunjer said Installing lib32stdc++6 fixed it for Debian 9 as well.
but when running sudo apt get install lib32stdc++6, it is trying to remove multiple packages.. i doubt it might create problems to other s/w in system.

$ sudo apt-get install lib32stdc++6
[sudo] password for jwx:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
hashcat-data libasan3 libboost-atomic1.62.0 libboost-chrono1.62.0
libboost-program-options1.62.0 libboost-serialization1.62.0
libboost-test1.62.0 libboost-timer1.62.0 libc-dev-bin libcgal12
libclang-common-3.8-dev libclang1-3.8 libevent-2.0-5 libffi-dev
libfreerdp-cache1.1 libfreerdp-client1.1 libfreerdp-codec1.1
libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1
libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-primitives1.1
libfreerdp-utils1.1 libgcc-6-dev libgom-1.0-common libllvm3.8 libobjc-6-dev
libobjc4 libsfcgal1 libtinfo-dev libtxc-dxtn-s2tc libwinpr-crt0.1
libwinpr-crypto0.1 libwinpr-dsparse0.1 libwinpr-environment0.1
libwinpr-file0.1 libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1
libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1
libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1
libwinpr-synch0.1 libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1
linux-libc-dev llvm-3.8 llvm-3.8-dev llvm-3.8-runtime python-all python-bson
python-bson-ext python-dbus python-gridfs python-keyring python-keyrings.alt
python-pip python-pip-whl python-pymongo python-pymongo-ext
python-secretstorage python-wheel
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
cpp-7 gcc-7 gcc-7-base gcc-8-base lib32gcc1 libasan4 libatomic1 libc-bin
libc-dev-bin libc6 libc6-dbg libc6-i386 libcc1-0 libcilkrts5 libexpat1
libgcc-7-dev libgcc1 libgfortran4 libgomp1 libgtksourceview2.0-0
libgtksourceview2.0-common libitm1 liblsan0 libmpc3 libmpfr6 libmpx2
libobjc4 libquadmath0 libstdc++6 libtsan0 libubsan0 locales
python-gtksourceview2
Suggested packages:
gcc-7-locales gcc-7-multilib gcc-7-doc libgcc1-dbg libgomp1-dbg libitm1-dbg
libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc
libgtksourceview2.0-dev
Recommended packages:
libc6-dev
The following packages will be REMOVED:
bluelog build-essential clang clang-3.8 g++ g++-7 glusterfs-common golismero
hashcat kali-linux-full libacl1-dev libattr1-dev libbluetooth-dev libc6-dev
libexpat1-dev libpocl1 libpocl1-common libpython-all-dev libpython-dev
libpython2.7-dev libstdc++-6-dev libstdc++-7-dev pocl-opencl-icd
python-all-dev python-dev python2.7-dev

The following NEW packages will be installed:
gcc-8-base lib32gcc1 lib32stdc++6 libc6-i386 libgtksourceview2.0-0
libgtksourceview2.0-common libmpfr6 python-gtksourceview2
The following packages will be upgraded:
cpp-7 gcc-7 gcc-7-base libasan4 libatomic1 libc-bin libc-dev-bin libc6
libc6-dbg libcc1-0 libcilkrts5 libexpat1 libgcc-7-dev libgcc1 libgfortran4
libgomp1 libitm1 liblsan0 libmpc3 libmpx2 libobjc4 libquadmath0 libstdc++6
libtsan0 libubsan0 locales
26 upgraded, 8 newly installed, 26 to remove and 216 not upgraded.
Need to get 40.9 MB of archives.
After this operation, 298 MB disk space will be freed.
Do you want to continue? [Y/n]
--> My system is 64bit.
--> OS installed : $ uname -a
Linux mypc 4.13.0-kali1-amd64 #1 SMP Debian 4.13.10-1kali2 (2017-11-08) x86_64 GNU/Linux
(kali linux 2017.3)

@emdete

This comment has been minimized.

emdete commented Mar 14, 2018

it seems android-arm-*/linux-x64 contains 32bit executables (as emulator/lib64/libstdc++ from android sdk which i just deleted to use the system installed ones). i just did a

cd flutter/bin/cache/artifacts/engine
cp android-arm64-profile/linux-x64/gen_snapshot android-arm-profile/linux-x64/gen_snapshot
cp android-arm64-release/linux-x64/gen_snapshot android-arm-release/linux-x64/gen_snapshot

as a workaround. after that flutter doctor is fine and i can build & run the sample app on my android phone.

would be good to know why 32bit is on a 64bit system and why it is tried to be loaded.

@MrSlayers

This comment has been minimized.

MrSlayers commented Mar 17, 2018

On Fedora 27 I tried

dnf install libstdc++.i686

But already installed on my system...
Help !

@MrSlayers

This comment has been minimized.

MrSlayers commented Mar 17, 2018

With #6207 (comment) comment that's work !

DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this issue May 14, 2018

Improve error message for missing 32-bit libstc++ (flutter#15004)
Adds more actionable error messages for users of the most common Linux
distributions. We could improve this by checking the current
distribution and emitting only the appropriate error message. We could
further improve that by only emitting the install instructions if we
determine the appropriate package is not installed.

See: flutter#6207
@benbucksch

This comment has been minimized.

benbucksch commented Jul 20, 2018

Ubuntu 16.04 with all updates:

# apt-get update
# apt-get upgrade
# apt-get install lib32stdc++6
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 lib32stdc++6 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8-20180424-0ubuntu1~16.04.1 is to be installed
                Depends: lib32gcc1 (>= 1:4.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

However, flutter run appears to work (No connected devices is a separate issue):

$ flutter run
No connected devices.
$ flutter run --release
No connected devices.

despite flutter doctor (flutter from git checkout) complaining:

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel unknown, v0.5.8-pre.71, on Linux, locale de_DE.UTF-8)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information
      On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
@funkybaboon

This comment has been minimized.

funkybaboon commented Aug 20, 2018

How do I fix this on centos7? Installing libstdc++ ist not working.

[root@9f4595cf5fe7 /]# yum -y -q install libstdc++
Package libstdc++-4.8.5-28.el7_5.1.x86_64 already installed and latest version
[root@9f4595cf5fe7 /]# flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel unknown, v0.5.7, on Linux, locale en_US)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information
      On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
      On Fedora: dnf install libstdc++.i686
      On Arch: pacman -S lib32-libstdc++5
      
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✗] Android Studio (not installed)
[!] Connected devices
    ! No devices available

! Doctor found issues in 3 categories.
@funkybaboon

This comment has been minimized.

funkybaboon commented Aug 28, 2018

With this workaround posted earlier I can build on centos7: #6207 (comment)

@JakeRed

This comment has been minimized.

JakeRed commented Sep 5, 2018

After reading the above answer, I couldn't find a way for MacOS to successfully run the flutter doctor command. Has anyone succeeded? this is error info:

[!] Flutter (Channel beta, v0.6.0, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
• Flutter version 0.6.0 at /Users/yimutian/flutter
• Framework revision 9299c02 (3 weeks ago), 2018-08-16 00:35:12 +0200
• Engine revision e3687f70c7
• Dart version 2.1.0-dev.0.0.flutter-be6309690f
✗ Downloaded executables cannot execute on host.
See #6207 for more information

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
• Android SDK at /Users/yimutian/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

Looking forward to your help!

@cbracken

This comment has been minimized.

Member

cbracken commented Sep 5, 2018

@JakeRed your error looks unrelated to this bug, which is Linux-specific. Apologies for the confusing error message. It seems as though your Flutter install is somehow corrupt. Can you try the following from a terminal window and see if it helps?

rm -rf ~/flutter/bin/cache
flutter doctor --verbose

Based on your locale, in case you're in China, it may be useful to follow our instructions for using Flutter in China.

@JakeRed

This comment has been minimized.

JakeRed commented Sep 5, 2018

@cbracken Thank you for your answer, Your answer has solved my problem.
I am in China, but I use VPN.

@oswee

This comment has been minimized.

oswee commented Nov 9, 2018

sudo dnf install libstdc++.i686
....
Error: Transaction check error: file /usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-37.opt-1.pyc from install of libstdc++-8.2.1-5.fc29.i686 conflicts with file from package libstdc++-8.2.1-4.fc29.x86_64 file /usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-37.pyc from install of libstdc++-8.2.1-5.fc29.i686 conflicts with file from package libstdc++-8.2.1-4.fc29.x86_64 file /usr/share/gcc-8/python/libstdcxx/v6/printers.py from install of libstdc++-8.2.1-5.fc29.i686 conflicts with file from package libstdc++-8.2.1-4.fc29.x86_64
I have some Apache Kafka Client, Docker, Go, stuff installed and i need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment