我已通过此命令创建了一个新项目
flutter create newproject
创建项目后,我启动了此命令
flutter run
然后输出
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 0.6s
Resolving dependencies... 1.0s
Running 'gradlew assembleDebug'...
/home/Flutter/flutter/bin/cache/artifacts/engine/android-arm-profile/linux-x64/gen_snapshot: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Failed to run the Flutter compiler. Exit code: 127
FAILURE: Build failed with an exception.
Where:
Script '/home/Flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 421
What went wrong:
Execution failed for task ':app:flutterDependenciesDebug'.
Process 'command '/home/Flutter/flutter/bin/flutter'' finished with non-zero exit value 127
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
Gradle build failed: 1
`
什么事情发生了,我无法理解
提前致谢
答案 0 :(得分:2)
如果您使用的是Linux版本,请添加lib32 std c ++依赖项,如下所述
On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
On Fedora: dnf install libstdc++.i686
On Arch: pacman -S lib32-libstdc++5
更多细节在下面flutter github票 https://github.com/flutter/flutter/issues/15025