最终修复它的是隐藏在 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