【问题标题】:Class AMSupportURLConnectionDelegate is implemented in both ?? (0x204ba8188) and ?? (0x1145382b8). One of the two will be used. Which one is undefined类 AMSupportURLConnectionDelegate 在两者中都实现了?? (0x204ba8188) 和?? (0x1145382b8)。将使用两者之一。哪个是未定义的
【发布时间】:2021-03-06 04:45:38
【问题描述】:

我正在 M1(Apple Silicon)上运行颤振项目。该项目在 Apple Intel 和 Windows 上运行。请在我进入flutter run时查看我的错误消息

Prasaths-MacBook-Pro:Foodom_ios prasathsivanathan$ flutter run 
Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...                                                  
Xcode build done.                                            1.6s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[20641]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x204ba8188) and ??
    (0x113e842b8). One of the two will be used. Which one is undefined.
    objc[20641]: Class AMSupportURLSession is implemented in both ?? (0x204ba81d8) and ?? (0x113e84308). One of
    the two will be used. Which one is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    In file included from
    /Users/prasathsivanathan/Desktop/Projects/Flutter/Test/Foodom_ios/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/
    Utilities/FIRAuthURLPresenter.m:24:
    /Users/prasathsivanathan/Desktop/Projects/Flutter/Test/Foodom_ios/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/
    Utilities/FIRAuthDefaultUIDelegate.h:18:24: error: 'TARGET_OS_WATCHOS' is not defined, evaluates to 0
    [-Werror,-Wundef-prefix=TARGET_OS_]
    #if !TARGET_OS_OSX && !TARGET_OS_WATCHOS
                           ^
    1 error generated.
    In file included from
    /Users/prasathsivanathan/Desktop/Projects/Flutter/Test/Foodom_ios/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/
    Utilities/FIRAuthDefaultUIDelegate.m:23:
    /Users/prasathsivanathan/Desktop/Projects/Flutter/Test/Foodom_ios/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/
    Utilities/FIRAuthDefaultUIDelegate.h:18:24: error: 'TARGET_OS_WATCHOS' is not defined, evaluates to 0
    [-Werror,-Wundef-prefix=TARGET_OS_]
    #if !TARGET_OS_OSX && !TARGET_OS_WATCHOS
                           ^
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a
    placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner'
    from project 'Runner')

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

【问题讨论】:

标签: ios flutter apple-m1


【解决方案1】:

我昨天解决了这个问题;

请先在您的 xcode 上查看您的 apple dev 帐户,然后使用 xcode 运行您的项目,并输入您的密码,信任您的证书。在你的xcode构建成功后,你现在可以在你的idea(Android Studio)上运行它了。

【讨论】:

    【解决方案2】:

    我有同样的问题,偶然解决了。 试试看(不确定这是否有效)

    flutter clean 
    rm ios/Podfile ios/Podfile.lock pubspec.lock
    rm -rf ios/Pods ios/Runner.xcworkspace
    

    【讨论】:

    • M1 是一款非常适合开发者的产品。并且开发者应该有足够的知识来理解 M1 是第一代,这意味着不是所有的软件都已经调整过,并且足够用arch -x86_64 .... whatever command you want运行rosetta@
    • @daniel.gindi 这是我认为我见过的最糟糕的开发人员气体照明案例
    • @martinseal1987 我不知道如何解释您的评论,但您看过原文吗?在我的生活中,我从未见过如此主观和无用的“答案”。
    【解决方案3】:
    1. 在您的 Mac M1 上安装 Rosetta 2,方法是在终端中执行此操作:

    软件更新 --install-rosetta

    1. 在 Finder 中选择应用程序(终端)。
    2. 右键单击应用程序(终端)并选择获取信息。
    3. 一般情况下,请选中使用 Rosetta 打开复选框。
    4. 关闭终端信息。
    5. 退出终端并再次打开它。
    6. 现在在终端中,在您的命令前写入以下内容:

    arch -x86_64 [你的命令]

    Credit:daniel.gindi 给出了一条评论,让我能够弄清楚这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-14
      • 2021-03-13
      • 2021-04-09
      • 1970-01-01
      • 2013-09-18
      相关资源
      最近更新 更多