0

I'm installing flutter in a centos7 docker container. It's complaining that there are executables that can't be executed. A solution is there, but not for centos7:

[!] Flutter (Channel @{u}, v0.0.0-unknown, 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

A search on https://pkgs.org for lib32stdc++6, libstdc++.i686, lib32-libstdc++5didn't show a package for centos7. The github issue does not mention centos at all.

Which package of lib...++ do I need to install in my centos7 docker container to get flutter running?

This issue seems to be related to Flutter version Unknown

I have installed the newest git version as described here. However I'm still getting the same error.

mles
  • 4,534
  • 10
  • 54
  • 94

2 Answers2

2

What finally fixed it was this comment hidden in a Github Issue:

https://github.com/flutter/flutter/issues/6207#issuecomment-373100050

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

Update October 2018: We have moved away from this fix, as the app built this way crashes on the device. The resolution was to build flutter apps not on centos7. We now use a Docker Container based on this Dockerfile:

https://hub.docker.com/r/nathansamson/flutter-builder-docker/~/dockerfile/

FROM fedora:28

ENV ANDROID_COMPILE_SDK=28
ENV ANDROID_BUILD_TOOLS=28.0.1
ENV ANDROID_SDK_TOOLS=4333796
ENV FLUTTER_VERSION=0.7.3-beta

RUN dnf update -y \
    && dnf install -y wget tar unzip ruby ruby-devel make autoconf automake redhat-rpm-config lcov\
           gcc gcc-c++ libstdc++.i686 java-1.8.0-openjdk-devel xz git mesa-libGL mesa-libGLU\
    && dnf clean all

RUN wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip \
    && unzip android-sdk.zip -d /opt/android-sdk-linux/ \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "platform-tools" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "extras;android;m2repository" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "extras;google;google_play_services" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "extras;google;m2repository" \
    && yes | /opt/android-sdk-linux/tools/bin/sdkmanager  --licenses || echo "Failed" \
    && rm android-sdk.zip

ENV ANDROID_HOME=/opt/android-sdk-linux
ENV PATH=$PATH:/opt/android-sdk-linux/platform-tools/

RUN wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/beta/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz \
    && tar xf flutter.tar.xz -C /opt \
    && rm flutter.tar.xz

ENV PATH=$PATH:/opt/flutter/bin

RUN echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "emulator" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "system-images;android-18;google_apis;x86" \
    && echo "y" | /opt/android-sdk-linux/tools/bin/sdkmanager "system-images;android-27;google_apis_playstore;x86"

RUN dnf update -y \
    && dnf install -y pulseaudio-libs mesa-libGL  mesa-libGLES mesa-libEGL \
    && dnf clean all
mles
  • 4,534
  • 10
  • 54
  • 94
  • Used this Dockerfile to reproduce build problems on travis. Not a perfect match of travis, but works great! Would be nice if there was a version with the emulator already started. I think docker can support that, not sure if travis can. Then this travis integration testing would run faster: https://travis-ci.org/brianegan/flutter_architecture_samples – mmccabe Oct 30 '18 at 07:33
1

For CentOS 7.x, try installing libstdc++ package.

Query for package: yum search libstdc++

Install package: yum install libstdc++

libstdc++ is a part of the standard distribution for CentOS 7.x

GoinOff
  • 1,792
  • 1
  • 18
  • 37