leanflutter / auto_updater

This plugin allows Flutter desktop apps to automatically update themselves (based on sparkle and winsparkle).
MIT License
278 stars 38 forks source link

【MAC OS】flutter run --release。无法启动Sparkle。 #60

Open clong1995 opened 5 months ago

clong1995 commented 5 months ago

flutter run --release。无法启动Sparkle。打包后也没法启动Sparkle。 但是使用 flutter run --debug或者调试模式打包,可以启动Sparkle,并正确完成更新。

lijy91 commented 5 months ago

检查一下Release模式是否开启了沙盒,沙盒化的配置请参考这里 https://sparkle-project.org/documentation/sandboxing/

lijy91 commented 5 months ago

无法启动是指什么?有没有具体的日志?

clong1995 commented 5 months ago

沙盒确定没启用,flutter中没有任何日志。 但是我找到了临时解决办法:

await autoUpdater.setFeedURL(feedURL);
await autoUpdater.setScheduledCheckInterval(3600);
//延时了一秒,每次Sparkle都能成功出现更新提示。
Future.delayed(const Duration(seconds: 1), () async {
  await autoUpdater.checkForUpdates();
});

延时解决了我的问题,但是我不知道这样做是否正确。