0

我在 centos7 docker 容器中安装颤振。它抱怨有无法执行的可执行文件。有一个解决方案,但不适用于 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

https://pkgs.org上搜索 ,没有lib32stdc++6显示centos7 的软件包。github问题根本没有提到centos。libstdc++.i686lib32-libstdc++5

我需要在我的 centos7 docker 容器中安装哪个软件包lib...++才能运行颤振?

这个问题似乎与Flutter 版本未知有关

我已经按照此处所述安装了最新的 git 版本。但是我仍然遇到同样的错误。

4

2 回答 2

2

最终修复它的是隐藏在 Github 问题中的这条评论:

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

2018 年 10 月更新:我们已不再进行此修复,因为以这种方式构建的应用程序在设备上崩溃。解决方案是在 centos7 上构建 Flutter 应用程序。我们现在使用基于这个 Dockerfile 的 Docker 容器:

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
于 2018-08-30T14:34:20.853 回答
1

对于 CentOS 7.x,请尝试安装 libstdc++ 软件包。

包裹查询:yum search libstdc++

安装包:yum install libstdc++

libstdc++ 是 CentOS 7.x 标准发行版的一部分

于 2018-08-10T17:35:29.577 回答