用于测试飞行的 Flutter Archive 应用程序给出错误 ITMS-90338:非 public API 用法

Flutter Archive app to testflight gives error ITMS-90338: Non-public API usage

我正在开发 Flutter 应用程序并尝试将新构建上传到 testFlight

flutter doctor -v

[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.5 19F101, locale en-US) • Flutter version 1.9.1+hotfix.6 at /Users/shadysherif/Documents/Dev/flutter • Framework revision 68587a0916 (10 months ago), 2019-09-13 19:46:58 -0700 • Engine revision b863200c37 • Dart version 2.5.0

[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/setup/#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location. You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.9.3

[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[!] Connected device ! No devices available

! Doctor found issues in 3 categories.

问题 #1

归档应用程序并将其上传到 testFlight 后,我​​收到一条成功消息,但在 testFlight 上找不到任何构建。我等了 10 多分钟,testFlight 显示 no builds。我尝试了很多次,我也尝试导出而不是上传,因为一位同事告诉我上传时可能是 XCode 问题,我使用了该工具,但我没有运气。

最后,我发现错误已作为电子邮件发送到我的开发者帐户邮箱!!!

问题 #2

很高兴我发现了错误,这里是所有详细信息:

We identified one or more issues with a recent delivery for your app, "app name" version. Please correct the following issues, then upload again.

ITMS-90338: Non-public API usage - The app references non-public symbols in Frameworks/Flutter.framework/Flutter: _ptrace. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

我在网上没有找到太多帮助

这是有线问题,不知道Xcode为什么要编译存档开发符号!

解决方法很简单,运行 flutter 项目根目录下的命令

flutter clean
rm -rf ios/Flutter/Flutter.framework
flutter build ios --release

然后product -> archive,构建会直接上传到TestFlight,但可能需要一段时间处理。