firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.73k stars 3.98k forks source link

firebase_auth: ^5.3.1 - 'headerValue()" is unavailable in Swift. #13531

Closed Polibuzz closed 1 month ago

Polibuzz commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

On every run attempt, I get this error: Swift Compiler Error (Xcode): 'headerValue()' is unavailable in Swift: Use asyncHeaderValue() async -> String? instead.

Reproducing the issue

I am trying to run my flutter app. I've updated all the Pods but the error consistently happens. When I go into the source code to alter the offending lines, the app starts but doesn't get by authentication.

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

Swift Compiler Error (Xcode): 'headerValue()' is unavailable in Swift: Use `asyncHeaderValue() async -> String?` instead.
/Users/jeanniebreitenbach/family_farms_forever/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift:111:39

Flutter dependencies

Expand Flutter dependencies snippet
```yaml dependencies: flutter: sdk: flutter square_in_app_payments: ^1.7.9 flutter_lints: ^4.0.0 cupertino_icons: ^1.0.2 http: ^1.1.0 json_serializable: ^6.6.1 provider: ^6.0.4 csv: ^6.0.0 change_app_package_name: ^1.1.0 geolocator: ^12.0.0 image: ^4.0.15 mailto: ^2.0.0 cloud_functions: ^5.1.3 google_fonts: ^6.2.1 google_places_flutter: ^2.0.8 stacked_services: ^1.5.0 flutter_paypal_native: ^2.1.0 location: ^6.0.2 flutter_svg: ^2.0.1 fluster: ^1.2.0 cached_network_image: ^3.1.0 flutter_rating_bar: ^4.0.0 uuid: ^4.2.1 shared_preferences: ^2.2.0 lottie: ^3.1.2 flutter_google_maps_webservices: ^1.1.1 flutter_polyline_points: ^2.0.0 rxdart: ^0.27.7 google_sign_in: ^6.0.2 url_launcher: ^6.1.11 geocoding: ^3.0.0 page_transition: ^2.0.9 flip_card: ^0.7.0 flutter_rating_stars: ^1.0.3+4 pointer_interceptor: ^0.10.0 dio: ^5.0.0 firebase_core: ^3.6.0 cloud_firestore: ^5.3.0 path: ^1.8.0 sign_in_with_apple: ^6.1.2 path_provider: ^2.1.0 firebase_database: ^11.0.1 video_player: ^2.7.0 flutter_dotenv: ^5.1.0 multi_select_flutter: ^4.1.3 animated_splash_screen: ^1.3.0 image_picker: ^1.0.2 local_auth: ^2.1.7 google_api_headers: ^4.0.2 google_maps_flutter: ^2.7.0 firebase_storage: ^12.0.1 flutter_secure_storage: ^9.0.0 share_plus: ^10.0.0 convex_bottom_bar: ^3.2.0 sign_in_button: ^3.2.0 flutter_slidable: ^3.0.0 flutter_zoom_drawer: ^3.0.4+1 permission_handler: ^11.1.0 mask_text_input_formatter: ^2.4.0 network_image: ^0.1.1 flutter_riverpod: ^2.3.6 hooks_riverpod: ^2.3.6 video_thumbnail: ^0.5.3 qr: ^3.0.1 file_picker: ^8.0.5 fl_chart: ^0.69.0 js: ^0.6.3 intl: ^0.19.0 speech_to_text: ^6.6.0 photo_view: ^0.15.0 firebase_auth_platform_interface: ^7.0.5 flutter_email_sender: ^6.0.2 simple_animations: ^5.0.2 quiver: ^3.2.1 flutter_cache_manager: ^3.3.1 google_generative_ai: ^0.4.2 mailer: ^6.1.0 pdf_render: ^1.4.6 badges: ^3.1.2 apple_maps_flutter: ^1.3.0 intl_phone_number_input: ^0.7.4 webview_flutter: ^4.8.0 flutter_libphonenumber: ^2.3.3 device_info_plus: ^10.1.0 flutter_emoji: ^2.5.1 app_tracking_transparency: ^2.0.6 audioplayers: ^6.1.0 confetti: ^0.7.0 google_sign_in_web: ^0.12.4+1 webview_flutter_android: ^3.16.4 webview_flutter_wkwebview: ^3.14.0 logger: ^2.4.0 convex_bottom_app_bar: ^1.0.3 flutter_map: ^7.0.2 latlong2: ^0.9.1 flutter_pdfview: ^1.3.2 googleapis: ^13.2.0 googleapis_auth: ^1.6.0 flutter_cached_pdfview: ^0.4.2 camera: ^0.11.0+2 openfoodfacts: ^3.13.0 table_calendar: ^3.1.2 flutter_event_calendar: ^1.0.0 timezone: ^0.9.4 font_awesome_flutter: ^10.7.0 flutter_facebook_auth: ^7.1.1 flutter_web_auth_2: ^4.0.0 flutter_barcode_scanner: ^2.0.0 flutter_native_timezone: ^2.0.0 webview_flutter_platform_interface: ^2.10.0 webview_cookie_manager: ^2.0.6 crypto: ^3.0.5 universal_html: ^2.2.4 add_2_calendar: ^3.0.1 flutter_stripe: ^11.2.0 firebase_auth: ^5.3.1 dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.3.3 flutter_launcher_icons: ^0.13.1 ```

Additional context and comments

No response

SelaseKay commented 1 month ago

Duplicate of: https://github.com/firebase/flutterfire/issues/13527

Moskaoud commented 2 weeks ago

this works for me and build success line 112 before error

if let heartbeatLogger = requestConfiguration.heartbeatLogger {
      request.setValue(heartbeatLogger.headerValue(), forHTTPHeaderField: "X-Firebase-Client")
    }

solution

 if let heartbeatLogger = requestConfiguration.heartbeatLogger {
        await request.setValue(heartbeatLogger.asyncHeaderValue(), forHTTPHeaderField: "X-Firebase-Client")
    }

image