【问题标题】:Flutter Error: FIROAuthProvider credentialWithProviderID:provider颤振错误:FIROAuthProvider credentialWithProviderID:provider
【发布时间】:2020-05-17 01:54:18
【问题描述】:

我有一个颤振构建的应用程序,想添加 firebase_auth 和 cloud_firestore。它曾经工作顺利。然后我将以下两行添加到 pubspec.yaml 中:

  firebase_auth: ^0.15.4
  cloud_firestore: ^0.13.0+1

并运行包获取。不做任何其他事情,如果我运行我的项目,它会给出以下错误:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                           132.2s
Failed to build iOS app
Error output from Xcode build:
↳
    2020-01-31 14:17:56.015 xcodebuild[41367:4940394]  DTDeviceKit: deviceType from 00008006-0007354C3EFA002E was NULL
    2020-01-31 14:17:57.763 xcodebuild[41367:4940338] [MT] iPhoneConnect: ????<DVTiOSDevice (0x7fbdeb156390), Baseduo, iPhone, 13.3.1 (17D5050a), 4be1310269eaf14dd153c6def229bddceaeebbe6> == Underlying device preparation errors ==
    2020-01-31 14:17:57.763 xcodebuild[41367:4940338] [MT] iPhoneConnect: ????<DVTiOSDevice (0x7fbdeb156390), Baseduo, iPhone, 13.3.1 (17D5050a), 4be1310269eaf14dd153c6def229bddceaeebbe6> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
    Domain: com.apple.platform.iphoneos
    Code: 5
    Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fbde662bd20:'com.apple.platform.iphoneos':<DVTFilePath:0x7fbde662bca0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
    --
    2020-01-31 14:17:57.763 xcodebuild[41367:4940338] [MT] iPhoneConnect: ????<DVTiOSDevice (0x7fbdeb156390), Baseduo, iPhone, 13.3.1 (17D5050a), 4be1310269eaf14dd153c6def229bddceaeebbe6> == END: Underlying device preparation errors ==
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/Baseduo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.15.4/ios/Classes/FLTFirebaseAuthPlugin.m:505:38: error: no known class method for selector 'credentialWithProviderID:IDToken:rawNonce:accessToken:'
          credential = [FIROAuthProvider credentialWithProviderID:provider
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/Baseduo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.15.4/ios/Classes/FLTFirebaseAuthPlugin.m:514:38: error: no known class method for selector 'credentialWithProviderID:IDToken:rawNonce:'
          credential = [FIROAuthProvider credentialWithProviderID:provider
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2 errors generated.
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    note: Using new build system
    note: Planning build
    note: Constructing build description

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

Flutter Doctor 也没有回应:

/Users/Baseduo/Developer/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.2 19C57, locale en-TR)
    • Flutter version 1.12.13+hotfix.7 at /Users/Baseduo/Developer/flutter
    • Framework revision 9f5ff2306b (4 days ago), 2020-01-26 22:38:26 -0800
    • Engine revision a67792536c
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/Baseduo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.9.0.beta.2

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available)
    • Baseduo             • 4be1310269eaf14dd153c6def229bddceaeebbe6 • ios • iOS 13.3.1
    • iPhone 11 Pro Max • 954398E8-1CB7-4189-B2E6-84E9F87BB94A     • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

! Doctor found issues in 1 category.
Process finished with exit code 0

我找不到任何措施来解决这个问题并感谢您的回答。

谢谢,

ps:我在其他应用中使用了相同的操作,没有问题。

ps2:适用于安卓模拟器。

【问题讨论】:

    标签: ios firebase android-studio flutter ios-simulator


    【解决方案1】:

    在 ios 目录中运行 pod update 可以解决问题(至少到下一次)。见this bug report

    【讨论】:

    • 不,它不起作用。我已经(现在又一次)运行pod repo update,然后运行sudo gem install cocoapods,然后运行pod setup。不幸的是,这并不能解决我的问题。
    猜你喜欢
    • 2018-10-30
    • 1970-01-01
    • 2021-06-30
    • 2021-07-04
    • 2019-03-14
    • 2022-07-03
    • 2021-10-07
    • 2021-08-08
    • 2020-04-08
    相关资源
    最近更新 更多