-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
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-6ubuntu1~16.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
-
Install Ubuntu 16.04 using this image
http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-amd64.iso -
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
-
Install Dart SDK for Atom
https://www.dartlang.org/install/linux -
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
- Install Atom
Downloaded deb file from atom.io
Installed deb
a) Dart & Flutter for Atom
apm install flutter
apm install dartlang
flutter doctoroutput now
raju@ubuntu:~/coding$ flutter doctor
[✓] Flutter (on Linux, channel master)
• Flutter at /home/raju/dev/flutter
• Framework revision 9f673ad445 (5 hours ago), 2016-10-04 08:20:24
• Engine revision 27d012a790
• 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
- Create new app
flutter create helloworld
cd helloworld
flutter run