Flutter AMSupportURLConnectionDelegate 在两者中都实现了?错误

Mil*_*les 8 xcode ios dart flutter

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

\n
Running "flutter pub get" in Flutter_the app copy 3...        760ms\nLaunching lib/main.dart on iPhone 11 in debug mode...\nRunning pod install...                                             986ms\nRunning Xcode build...                                                  \nXcode build done.                                            1.5s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n   objc[95181]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x20ba238f0) and ??\n   (0x1160dc2b8). One of the two will be used. Which one is undefined.\n   objc[95181]: Class AMSupportURLSession is implemented in both ?? (0x20ba23940) and ?? (0x1160dc308). One\n   of the two will be used. Which one is undefined.\n   ** BUILD FAILED **\n\n\nXcode's output:\n\xe2\x86\xb3\n   note: Using new build system\n   note: Building targets in parallel\n   note: Planning build\n   note: Constructing build description\n   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:\n   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')\n   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:\n   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')\n   error: /Users/gorkem/Documents/flutter_workspace/Flutter_the app copy 3/ios/Flutter/Debug.xcconfig:\n   unable to open file (in target "Runner" in project "Runner") (in target 'Runner' from project 'Runner')\n   warning: Unable to read contents of XCFileList '/Target Support\n   Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project\n   'Runner')\n   error: Unable to load contents of file list: '/Target Support\n   Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist' (in target 'Runner' from project\n   'Runner')\n   error: Unable to load contents of file list: '/Target Support\n   Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project\n   'Runner')\n\nCould not build the application for the simulator.\nError launching application on iPhone 11.\n
Run Code Online (Sandbox Code Playgroud)\n

有什么办法可以解决这个问题吗?我不确定问题是否写在那里。

\n

Muh*_*dil 11

我收到这个错误

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

笔记:

如果您已从 <=2.8 更新到 flutter 2.10,请先尝试此操作

flutter pub upgrade 
Run Code Online (Sandbox Code Playgroud)

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

installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

flutter clean
flutter pub get
cd ios
pod install  
Run Code Online (Sandbox Code Playgroud)

或者您可以尝试下面的 M1 来代替最后一个命令

arch -x86_64 pod install // for M1 
Run Code Online (Sandbox Code Playgroud)

运行您的应用程序。


小智 5

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

我能够通过执行以下操作来解决我的这个问题:

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

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