Flutter:如何修复 ITMS-90809:弃用 API 用法 - Apple 将停止接受使用 UIWebView APIs 的应用提交

Flutter: How to fix ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs

在提交我的最新版本时,Apple 突然返回消息说有问题,具体是:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

由于我没有使用 webview 插件,所以我不知道 UIWebView API 的使用位置。关于如何解决这个问题有什么建议吗?

此错误出现在最新的稳定版 flutter build 1.7.8+hotfix.4 中,并且包含以下软件包:

http: ^0.12.0
shared_preferences: ^0.4.3
intl: any
permission_handler: ^2.1.2
contacts_service: ^0.2.8
image: ^2.0.5
cached_network_image: ^1.0.0
url_launcher: ^5.0.1
path_provider: ^0.5.0+1
after_layout: ^1.0.7
connectivity: ^0.4.3+1
device_info: ^0.4.0+2
firebase_auth: ^0.11.1+7
firebase_messaging: ^5.1.2
firebase_analytics: ^5.0.0
notification_permissions: ^0.4.0

所有软件包都已更新到最新版本。

flutter doctor的输出是:

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6 18G87, locale en-US)
    • Flutter version 1.7.8+hotfix.4 at /Users/per/flutter
    • Framework revision 20e59316b8 (6 weeks ago), 2019-07-18 20:04:33 -0700
    • Engine revision fee001c93f
    • Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/per/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.7.4

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.25.1

[✓] Connected device (1 available)
    • Nexus 6P • 5VT7N15C31001152 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!

我在我们的 Cordova 应用程序中有这个,并通过更新依赖项修复了它。

您是否有机会使用依赖项或其他依赖项正在使用依赖项 "cordova-plugin-inappbrowser"。

如果是这样,这应该会在 3.1.0 中修复。查看发行说明 https://github.com/apache/cordova-plugin-inappbrowser/blob/master/RELEASENOTES.md PR 修复了它 https://github.com/apache/cordova-plugin-inappbrowser/pull/271

更新:尚未修复。查看 cordova-ios 上的问题:https://github.com/apache/cordova-ios/issues/661 请注意:没有截止日期,我已经联系了一位 Apple 开发人员,他一直在推特上发布关于迁移到 WKWebView 的信息,看看他是否可以提供更多信息,如果我得到回复,我会更新。

更新:Cordova-ios 5.1.0 似乎解决了这个问题。参见 https://github.com/apache/cordova-ios/pull/715

我认为它是从 firebase_auth 插件中使用的。 尝试将其更新到最新版本,然后记住 运行 pod update.

由于此拒绝消息已成为 Google 上的 "goto answer",我将添加 React Native 修复。

在 React Native 上,考虑到您是一名优秀的开发人员并且没有在自己的代码中使用 UIWebView,请使用以下命令找出您的哪些依赖项仍在使用 UIWebView:

grep -r UIWebView node_modules/*

还有更多信息 here

即使我没有在我的应用程序中使用 firebase_auth,我也在 Xcode 从 FirebaseAuth 搜索中找到对 UIWEBVIEW 的引用。似乎 Pods 默认包含此内容。所以这对我有用:

  1. 在 Xcode
  2. 中打开项目
  3. 打开Pods文件夹,你可能会看到很多子文件夹(包)
  4. 右键单击 FirebaseAuth 文件夹并select删除
  5. 然后select"Remove References"不是"Move to Trash"
  6. 构建项目
  7. UIWEBVIEW 引用应该消失了

在我的例子中,问题是我在调试中使用的 Flutter Facebook 插件版本

我不得不更改版本:

flutter_facebook_login: ^2.0.1

至:

flutter_facebook_login: ^3.0.0

还必须更改 pod 文件:

pod 'FBSDKCoreKit', '~> 4.39.1'
pod 'FBSDKLoginKit', '~> 4.39.1'

至:

pod 'FBSDKCoreKit', '~> 5.5'
pod 'FBSDKLoginKit', '~> 5.5'

然后这个函数的调用又出现了问题

fbLogin.logInWithReadPermissions(['email']);

刚刚替换为

fbLogin.logIn(['email']);

然后重建一切,并再次上传。