英文:
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
可以解决问题,但可能会影响应用程序的大小。
您可以执行以下操作:
- 转到系统偏好设置 > 隐私与安全性
- 向下滚动一点。
点击 仍要允许
,然后您可能需要重新构建。
英文:
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.
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:
Then right-click the file and select open (source):
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,你愿意使用这个未经苹果公证的代码。操作步骤如下:
- 打开Mac的系统设置
- 导航到隐私与安全
- 滚动到看到一个标题为'安全'的部分
- 如果你刚刚尝试构建一个应用程序捆绑包,你会看到一个字体子集部分,有一个按钮'仍然允许'。点击它,然后尝试重新构建你的应用程序捆绑包 - 应该可以工作。
英文:
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:
- Open up Mac's System Settings
- Navigate to Privacy and Security
- Scroll down until you see a section titled 'Security'
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论