Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 使用snapcraft为Linux snap软件包构建颤振应用程序时出错-CMake步骤失败_Flutter_Snapcraft - Fatal编程技术网

Flutter 使用snapcraft为Linux snap软件包构建颤振应用程序时出错-CMake步骤失败

Flutter 使用snapcraft为Linux snap软件包构建颤振应用程序时出错-CMake步骤失败,flutter,snapcraft,Flutter,Snapcraft,此问题已在此处提出,并(错误地)作为重复问题关闭,并链接到一个旧的CMAKE问题。可能最后的那个人没有正确地阅读问题。这与普通CMake配置无关,除非您希望在snapcraft源代码中配置CMake的使用 事实是运行snapcraft失败了。使用--debug运行它可以为您提供snapcraft/multipass文件系统的根控制台,whoami称为root,但您只能看到周围的快照(例如,不是您的主页)。不管怎样,错误是这样说的 CMake Error: The current CMakeCa

此问题已在此处提出,并(错误地)作为重复问题关闭,并链接到一个旧的CMAKE问题。可能最后的那个人没有正确地阅读问题。这与普通CMake配置无关,除非您希望在snapcraft源代码中配置CMake的使用

事实是运行snapcraft失败了。使用--debug运行它可以为您提供snapcraft/multipass文件系统的根控制台,whoami称为root,但您只能看到周围的快照(例如,不是您的主页)。不管怎样,错误是这样说的

CMake Error: The current CMakeCache.txt directory /root/parts/xxxxx/build/build/linux/release/CMakeCache.txt is different than the directory
/home/zolal/flutterapps/xxxxx/build/linux/release where CMakeCache.txt was created. This may result in binaries being created in the wrong
place. If you are not sure, reedit the CMakeCache.txt 
(当然,您不能重新编辑cmakcache.txt,因为它是由snapcraft创建的)

cmake构建似乎从snapcraft/multipass VM之外开始,然后移动到multipass VM,从而导致cmake错误。因为原来的问题是前一段时间提出的,显然这仍然不起作用。有人解决了这个问题吗

更新、清除多路径并尝试使用lxd:

snapcraft --use-lxd
Launching a container.
Waiting for container to be ready
Waiting for network to be ready...
snap "snapd" has no updates available
The flutter plugin is currently in beta, its API may break. Use at your own risk.
snapd is not logged in, snap install commands will use sudo
snap "core18" has no updates available
Skipping pull flutter-extension (already ran)
Skipping pull geraspine-outcome-pc (already ran)
Skipping pull gnome-3-28-extension (already ran)
Skipping build flutter-extension (already ran)
Building geraspine-outcome-pc 
flutter pub get
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
Delete build directory and build again.

src github-issue

If you got any error when building this, just run
snapcraft build --debug

Then delete the whole folder of
your_part_name
under
parts
folder

The solution is to execute following command inside your flutter project root folder (where the build, lib, snap, etc. folders are contained):

snapcraft clean <project-name>
snapcraft——使用lxd
发射集装箱。
等待容器准备就绪
正在等待网络准备就绪。。。
快照“snapd”没有可用的更新
颤振插件目前处于测试阶段,其API可能会崩溃。使用风险自负。
snapd未登录,snap安装命令将使用sudo
快照“core18”没有可用的更新
跳过拉动颤振扩展(已运行)
正在跳过从pc中提取数据(已运行)
跳过拉gnome-3-28-扩展(已运行)
跳过构建颤振扩展(已运行)
建立一个完整的个人电脑
飞舞酒吧
哇!你似乎试图以root用户的身份运行flutter。
我们强烈建议在没有超级用户权限的情况下运行颤振工具。
/

删除生成目录并重新生成


src

如果在构建此文件时出现任何错误,只需运行
snapcraft build--debug


然后删除
parts
folder

下的
part\u name
的整个文件夹。解决方案是在flatter项目根文件夹(其中包含build、lib、snap等文件夹)内执行以下命令:

但这包括所有依赖项。这意味着下次编译项目时必须再次下载所有依赖项

然后删除零件文件夹下您的零件名称的整个文件夹

这不起作用,因为“parts”文件夹位于“/root”目录中,我们无法手动访问或删除其中的内容


但是如果我们可以将零件文件夹更改为我们的/home目录,那就太好了。但我还没有发现任何可能性

这是不一样的。删除builddir并重试是我尝试的第一件事。GitHub上的问题是,cmake中的两个dir都从home开始,在我的例子中,第一个dir位于/root((多路径VM的根))。但是-很好的答案,因为我将开始一个GitHub问题。是的,这不应该是被接受的答案。这是一个不同的例子problem@amirzolal你找到解决这个问题的办法了吗?你能链接你提到的github问题吗?很抱歉,Damien,虽然我计划创建一个github问题,但我忘记了它(主要是因为到目前为止我只需要将windows可执行文件部署到其他计算机上)。我不再寻找解决方案,这根本不起作用。
snapcraft clean