【问题标题】:Flutter AMSupportURLConnectionDelegate is implemented in both ?? ErrorFlutter AMSupportURLConnectionDelegate 两者都实现了??错误
【发布时间】:2021-05-19 17:10:37
【问题描述】:

自从我将项目迁移到 Apple Silicon mac 后,我遇到了很多问题。我终于设法减少了问题,但不确定答案。

Running "flutter pub get" in Flutter_the app copy 3...        760ms
Launching lib/main.dart on iPhone 11 in debug mode...
Running pod install...                                             986ms
Running Xcode build...                                                  
Xcode build done.                                            1.5s
Failed to build iOS app
Error output from Xcode build:
↳
   objc[95181]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x20ba238f0) and ??
   (0x1160dc2b8). One of the two will be used. Which one is undefined.
   objc[95181]: Class AMSupportURLSession is implemented in both ?? (0x20ba23940) and ?? (0x1160dc308). One
   of the two will be used. Which one is undefined.
   ** BUILD FAILED **


Xcode's output:
↳
   note: Using new build system
   note: Building targets in parallel
   note: Planning build
   note: Constructing build description
   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:
   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')
   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:
   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')
   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:
   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')
   warning: Unable to read contents of XCFileList '/Target Support
   Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project
   'Runner')
   error: Unable to load contents of file list: '/Target Support
   Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist' (in target 'Runner' from project
   'Runner')
   error: Unable to load contents of file list: '/Target Support
   Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project
   'Runner')

Could not build the application for the simulator.
Error launching application on iPhone 11.

有没有办法解决这个问题。我不确定问题是否写在那里。

【问题讨论】:

标签: ios xcode flutter dart


【解决方案1】:

最近在更新到 Flutter 2.x 后,我的 M1 macbook 也收到了相同的“Xcode build 的错误输出”。

通过执行以下操作,我能够清除我的这个问题:

  • 将目录更改为项目的路径和子目录:

your_project/build/ios/Debug-iphonesimulator/

  • 运行 $ xattr -lr Runner.app
  • 运行 $ xattr -cr Runner.app

显然,flutter 项目在包含 Finder 信息的项目应用程序包中具有扩展属性,这会导致错误。

我发现这些链接有助于参考。 https://developer.apple.com/library/archive/qa/qa1940/_index.html https://github.com/flutter/flutter/issues/72492

【讨论】:

  • 兄弟你是救世主。非常感谢!
【解决方案2】:

我遇到了这个错误

类 AMSupportURLConnectionDelegate 在 /usr/lib/libauthinstall.dylib 中都实现了

解决方案: 请打开 podfile 并使用此脚本进行更新

installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end

flutter clean
flutter pub get
cd ios
pod install

运行您的应用程序。

【讨论】:

  • 我也遇到了@import firebase_auth 的问题。这个“AMSupportURLConnectionDelegate 在两者中都实现”是一个警告。尝试了一切,无法解决。尝试这样做以至少清除警告。也解决了 firebase 错误。
  • 很高兴知道它已经解决了您的问题。
【解决方案3】:

尝试在构建阶段选项卡的运行脚本中选择仅用于安装构建。

【讨论】:

    猜你喜欢
    • 2021-03-13
    • 2021-04-09
    • 1970-01-01
    • 2021-12-06
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    • 2022-07-16
    • 1970-01-01
    相关资源
    最近更新 更多