Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

huangapple go评论87阅读模式
英文:

Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

问题

"font-subset" 无法打开,因为苹果无法检查其是否包含恶意软件。

在没有声音空值安全性的情况下构建⚠️
Dart 3将仅支持声音空值安全性,请参阅https://dart.dev/null-safety

运行Gradle任务 'assembleRelease'...

目标aot_android_asset_bundle失败:IconTreeShakerException:字体子集化失败,退出代码为-9。

要禁用图标树抖动,请将 --no-tree-shake-icons 传递给请求的flutter build命令

失败:构建失败,出现异常。

英文:

“font-subset” can’t be opened because Apple cannot check it for malicious software.

Building without sound null safety ⚠️
Dart 3 will only support sound null safety, see https://dart.dev/null-safety

Running Gradle task 'assembleRelease'...

Target aot_android_asset_bundle failed: IconTreeShakerException: Font subsetting failed with exit code -9.

To disable icon tree shaking, pass --no-tree-shake-icons to the requested flutter build command

FAILURE: Build failed with an exception.

答案1

得分: 22

IconTreeShakerException: Font subsetting failed with exit code -9 错误通常表示 Flutter 中启用了 tree_shake_icons 设置,但在尝试从应用程序的包中移除未使用的图标以减小应用程序大小时遇到了问题。

尽管 flutter build ipa --no-tree-shake-icons 可以解决问题,但可能会影响应用程序的大小。

您可以执行以下操作:

  • 转到系统偏好设置 > 隐私与安全性
  • 向下滚动一点。

您应该看到这个:
Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

点击 仍要允许,然后您可能需要重新构建。

英文:

The IconTreeShakerException: Font subsetting failed with exit code -9 error typically indicates that the Flutter tree_shake_icons setting is enabled, but it encountered an issue while trying to remove unused icons from your app's package to reduce the size of the app.

While flutter build ipa --no-tree-shake-icons works, it might impact the size of your app.

What you can do is:

  • Go to system preferences > Privacy and Security
  • Scroll down a bit.

You should see this:
Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

Press allow anyway, you might have to build again.

答案2

得分: 9

When you get the pop-up, select Show in Finder:

然后右键单击文件并选择打开(来源):

Confirm that you want to open the file and it will be added as an exception to your mac.

英文:

When you get the pop-up, select Show in Finder:

Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

Then right-click the file and select open (source):

Flutter APK not build in Mac m2 “font-subset” can’t be opened because Apple cannot check it for malicious software

Confirm that you want to open the file and it will be added as an exception to your mac.

答案3

得分: 1

尝试使用以下命令:

IOS:

flutter构建ipa --no-tree-shake-icons

Android:

flutter构建appbundle --no-tree-shake-icons
英文:

Try using the commands below:

IOS:

flutter build ipa --no-tree-shake-icons

Android:

flutter build appbundle --no-tree-shake-icons

答案4

得分: 1

你需要告诉你的Mac,你愿意使用这个未经苹果公证的代码。操作步骤如下:

  1. 打开Mac的系统设置
  2. 导航到隐私与安全
  3. 滚动到看到一个标题为'安全'的部分
  4. 如果你刚刚尝试构建一个应用程序捆绑包,你会看到一个字体子集部分,有一个按钮'仍然允许'。点击它,然后尝试重新构建你的应用程序捆绑包 - 应该可以工作。
英文:

You'll need to tell your Mac that you are happy to use this code that hasn't been notarised with Apple. To do this:

  1. Open up Mac's System Settings
  2. Navigate to Privacy and Security
  3. Scroll down until you see a section titled 'Security'
  4. If you've just attempted to build an app bundle, you'll see a font-subset section with a button to 'allow anyway'. Tap this and then attempt to rebuild your app bundle - it should work.

huangapple
  • 本文由 发表于 2023年5月14日 23:08:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76248189.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定