gpt4 book ai didi

linux - Flutter for Linux 构建失败

转载 作者:行者123 更新时间:2023-12-05 06:03:32 26 4
gpt4 key购买 nike

任何启用了 linux 的 flutter 应用程序的 linux 构建都会导致以下错误:

flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/crtbegin.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/crtbegin.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/crtend.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/crtend.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crtn.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/crtn.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
/snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: //lib64/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
/snap/flutter/current/usr/bin/ld: warning: //lib64/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: //lib64/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libgcrypt.so.20: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libgcrypt.so.20: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/snap/flutter/current/usr/bin/ld: warning: //lib64/libgcrypt.so.20: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/snap/flutter/current/usr/bin/ld: warning: //lib64/libgcrypt.so.20: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Building Linux application...
Exception: Build process failed
My flutter doctor:
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_US.UTF-8)
• Flutter version 2.0.1 at /home/vtr/snap/flutter/common/flutter
• Framework revision c5a4b40 (9 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/vtr/Android/Sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /snap/android-studio/current/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /usr/bin/google-chrome-stable

[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1

[✓] Android Studio
• Android Studio at /snap/android-studio/current/android-studio
• Flutter plugin can be installed from:
hammer https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
hammer https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /snap/android-studio/current/android-studio
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (3 available)
• Note 7P (mobile) • • android-arm64 • Android 9 (API 28)
• Linux (desktop) • linux • linux-x64 • Linux
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.72

• No issues found!

系统信息系统:内核:5.9.16-1-MANJARO x86_64 位:64 编译器:gcc v:10.2.1 桌面:KDE Plasma 5.21.2 发行版:Manjaro Linux

flutter升级到2.0.0版本出现的错误以前的版本完美运行

最佳答案

你应该更新 flutter (Channel stable) 版本到 2.0.3 。这个版本的flutter run没有这个问题。

更新的答案

此问题的通用解决方案是卸载从 snap 安装的 flutter,然后从 AUR 安装。

从 AUR 安装 flutter-->yay -S flutter

您可能会遇到一些权限问题。以下是修复权限的方法:

创建一个新组 flutterusers,将默认用户添加到该组,然后更改文件夹 /opt/flutter 的权限。

sudo groupadd flutterusers
sudo gpasswd -a $USER flutterusers
sudo chown -R :flutterusers /opt/flutter
sudo chmod -R g+w /opt/flutter/

如果仍然出现权限拒绝错误,您还可以将 /opt/flutter 文件夹的权限更改为您的 $USER:

sudo chown -R $USER:flutterusers /opt/flutter

关于linux - Flutter for Linux 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66614590/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com