Wrong binary type for cv2 when uploading to Apple Cloud connect

オープン
#169 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
flutter, opencv, python

調査の方向性

まず cv2.abi3.so の Mach-O タイプと、serious_python_darwin.podspec における cv2 フレームワークの扱いを調査します。これを numpy wheel およびそこで受け入れられているバイナリタイプと比較します。flutter build ipa--cleanup-packages を使ってパッケージングフローを再現し、その後、Apple の検証で生成されたバンドルが受け入れられるために必要な変更を特定します。

索引モデルが issue の本文から書いたものです。

説明

Hello !

I've built and tested an Flutter app using Serious Python with several non-pure Python packages ( Like opencv ).
I've successfully publish my Apk but i got an error when publishing on the TestFlight of Apple Store.

Here are 3 issue about the same file cv2.cv2 explaining why Apple refuse my .ipa.

TMS-90171: Invalid bundle structure - The “Runner.app/Frameworks/cv2.cv2.framework/cv2.cv2” binary file is not permitted. Your app cannot contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. For details, visit: https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle

ITMS-90124: The binary is invalid - The executable 'Runner.app/Frameworks/cv2.cv2.framework/cv2.cv2' has type 'BUNDLE' that is not valid. Only 'EXECUTE' is permitted.

ITMS-90210: Missing load commands - The executable at 'Runner.app/Frameworks/cv2.cv2.framework' does not have the necessary load commands. Try rebuilding the app with the latest Xcode version. If you are using third party development tools, contact the provider.

If i download wheels (numpy and opencv) from the https://pypi.flet.dev/ repository, and i extract the content, the file command returned 2 differents output for the .so built.

$ file numpy_1_26_4_2_cp312_cp312_ios_13_0_arm64_iphoneos_whl/numpy/core/_umath_tests.cpython-312-iphoneos.so
_umath_tests.cpython-312-iphoneos.so: Mach-O 64-bit dynamically linked shared library arm64
$ file opencv_python_4_10_0_84_1_cp312_cp312_ios_13_0_arm64_iphoneos_whl/cv2/cv2.abi3.so
cv2.abi3.so: Mach-O 64-bit bundle arm64

Do you have any idea why this package is refused by AppleStore ? Did you succeed to publish a iOS app using this package ( using serious python or Flet ) ?
Is a workaround to recompile the package using mobile-forge and adding a compilation flag to change the file type?

Note :

  • I'm on MacOS 26 & xcode 26. (out Github actions CI building and publishing too)
  • Adding the cv2 xcframeworks as a resources instead of frameworks ( serious_python_darwin.podspec ) doesn't change the error.
  • I had to change the CFBundlePackageType from APPL to FRMK in all info.plist of all python packages, or i got an issue about BundleID and AppId. Cannot determine the Apple ID from Bundle ID 'org.python.numpy.random.-pcg64' and platform 'IOS'. (12)
  • Apple Profiles and certs should be okay as it is not our first app Version deployed with our CI.
  • serious_python ( forked ) is a dependencie of a custom Flutter plugin, which is a dependencie of our application.
  • I explored the cv2.cv2.frameworks and xcframeworks folder after "ios preparation", i can't see any other issue in the plists of this xcframeworks.
  • app is build with flutter build ipa ... and uploaded with xcrun altool --upload-package ./path/app.ipa --type ios
  • I used the --cleanup-packages arg of the package command to remove all .a files.

Thanks a lot for any insights and for this awesome package.

主要言語
Dart
スター
324
フォーク
47
平均マージ
7時間 41分
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

flet-dev/serious-python のほかの issue

flet-dev/serious-python の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。