简体   繁体   English

无法创建 Flutter linux 桌面应用程序 snapcraft 构建

[英]Not able to create flutter linux desktop application snapcraft build

I have developed a Linux desktop application with the help of flutter but now I am facing an error when I am trying to create the snapcraft build in #Flutter Project and the project is running perfectly when I am run on a Linux system .我在 Flutter 的帮助下开发了一个 Linux 桌面应用程序,但现在当我尝试在 #Flutter Project 中创建 snapcraft 构建时遇到错误,并且当我在 Linux 系统上运行时该项目运行良好。 Please let me know if anyone can connect with me and help me to solve this error.请让我知道是否有人可以与我联系并帮助我解决此错误。 when I was run snapcraft cmd to create project snap so terminal showed this error.当我运行 snapcraft cmd 来创建项目 snap 时,终端显示了这个错误。

**Error while processing... The store was unable to accept this snap. **处理时出错...商店无法接受此快照。

  • human review required due to 'deny-connection' constraint (interface attributes)由于“拒绝连接”约束(接口属性),需要人工审核
  • Could not find 'Exec=' in desktop file在桌面文件中找不到“Exec=”
  • Could not find 'Type=Application' in desktop file**在桌面文件中找不到“类型=应用程序”**

projectname.desktop file code projectname.desktop 文件代码

  Name=projectname
  Comment=projectname
  Exec=projectname
  Icon=snap/gui/projectname.png # replace name to your app name
  Terminal=false
  Type=Application
  Categories=Utility; #adjust accordingly your snap category```

snapcraft.yaml Code

```name: projectname
version: '1.0.8'
summary: projectname summary
description: |
             projectname description

confinement: strict
base: core18
grade: stable
# icon: snap/gui/projectname.png

# architectures:
#   - build-on: armhf
architectures:
  - build-on: armhf
    # run-on: amd64
system-usernames:
  snap_daemon: shared

slots:
  dbus-projectname: # adjust accordingly to your app name
    interface: dbus
    bus: session
    name: org.bar.projectname # adjust accordingly to your app name and
    
apps:
  projectname:
    command: projectname
    extensions: [flutter-master] # Where "master" defines which Flutter channel to use for the 
    # desktop: snap/gui/projectname.desktop
    plugs:
    - network
    - desktop
    slots:
      - dbus-projectname
parts:
  bstamp:
    source: .
    plugin: flutter
    flutter-target: lib/main.dart # The main entry-point file of the application```

I ran into exactly the same issue.我遇到了完全相同的问题。 I copy pasted from the guide on flutter.dev when creating my .desktop file.创建 .desktop 文件时,我从 flutter.dev 上的指南中复制粘贴。 That left all entries with preceding spaces.这留下了所有带有前面空格的条目。 Removing all the spaces fixed my issue.删除所有空格解决了我的问题。

If you fix those issues you'll still get the "human review required due to 'deny-connection' constraint (interface attributes)" but it will trigger a manual review this time after which you'll need to wait a couple of days for a human to review your submission.如果你解决了这些问题,你仍然会得到“由于'拒绝连接'约束(接口属性)而需要人工审查”,但这次它会触发人工审查,之后你需要等待几天一个人来审查您的提交。

I faced this issue a while ago and is was quit simple to solve.我不久前遇到了这个问题,并且很容易解决。 Check your .desktop file.检查您的 .desktop 文件。 It can't have extra spaces它不能有多余的空格

change this改变这个

  Name=projectname
  Comment=projectname
  Exec=projectname
  Icon=snap/gui/projectname.png # replace name to your app name
  Terminal=false
  Type=Application
  Categories=Utility; #adjust accordingly your snap category

to this对此

Name=projectname
Comment=projectname
Exec=projectname
Icon=snap/gui/projectname.png # replace name to your app name
Terminal=false
Type=Application
Categories=Utility; #adjust accordingly your snap category

I hope it helped you我希望它对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM