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.63k stars 3.95k forks source link

🐛 [Firebase Crashlytics] Failed build ios #6623

Closed AgustinV08 closed 3 years ago

AgustinV08 commented 3 years ago

Bug report

Describe the bug Updated firebase dependencies and try running in ios device but fails with output:

Failed to build iOS app Error output from Xcode build: ↳ objc[5006]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f444ac10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x12adb82b8). One of the two will be used. Which one is undefined. objc[5006]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1f444ac60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x12adb8308). One of the two will be used. Which one is undefined. 2021-07-15 16:25:09.458 xcodebuild[5006:11582873] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371 Details: (null) deviceType from e6c41479c61159c25d9c443dc62a2ee6d7a6e746 was NULL when -platform called. Object: <DTDKMobileDeviceToken: 0x1490324c0> Method: -platform Thread: <NSThread: 0x12c98b7e0>{number = 6, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. BUILD FAILED

Xcode's output: ↳ /Users/agustinvillanueva/Documents/apps/declara_facil/ios/Pods/Reachability/Reachability.m:465:63: warning: cast to smaller integer type 'unsigned int' from 'Reachability *' [-Wpointer-to-int-cast] NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]]; ^~~~~~~ 1 warning generated. /Users/agustinvillanueva/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-2.1.0/ios/Classes/FLTFirebaseCrashlyticsPl ugin.m:12:9: fatal error: 'FirebaseCrashlytics/FIRAnalyticsInterop.h' file not found

import <FirebaseCrashlytics/FIRAnalyticsInterop.h>

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/agustinvillanueva/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-2.1.0/ios/Classes/FLTFirebaseCrashlyticsPl
ugin.m:12:9: note: did not find header 'FIRAnalyticsInterop.h' in framework 'FirebaseCrashlytics' (loaded from
'/Users/agustinvillanueva/Documents/apps/declara_facil/build/ios/Debug-iphoneos/FirebaseCrashlytics')
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
/Users/agustinvillanueva/Documents/apps/declara_facil/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target
'Reachability' from project 'Pods')
/Users/agustinvillanueva/Documents/apps/declara_facil/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target
'Flutter' from project 'Pods')

Could not build the precompiled application for the device.

Error launching application on iPhone.

Steps to reproduce

Steps to reproduce the behavior:

Update firebase dependencies to: firebase_analytics: ^8.2.0 firebase_core: ^1.4.0 firebase_crashlytics: ^2.1.0


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale es-419) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.2) [✓] IntelliJ IDEA Ultimate Edition (version 2021.1.3) [✓] Connected device (2 available) • No issues found! ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.13.4 Flutter SDK 2.2.3 declara_facil 1.0.0+1 dependencies: - animations 2.0.1 [flutter] - awesome_dialog 2.1.0 [flutter simple_animations flare_flutter] - connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - cupertino_icons 1.0.3 - cupertino_will_pop_scope 1.1.0 [flutter] - dots_indicator 2.0.0 [flutter] - easy_localization 3.0.0 [flutter shared_preferences intl args path easy_logger flutter_localizations] - easy_localization_loader 1.0.0 [http csv yaml xml flutter] - email_validator 2.0.1 - firebase_analytics 8.2.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta] - firebase_core 1.4.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.1.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_easyloading 3.0.0 [flutter flutter_spinkit] - flutter_secure_storage 4.2.0 [meta flutter] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] - fluttericon 2.0.0 [flutter] - getwidget 2.0.3 [flutter] - http 0.13.3 [async http_parser meta path pedantic] - internet_connection_checker 0.0.1+1 [universal_io] - introduction_screen 2.1.0 [flutter dots_indicator] - lottie 1.1.0 [archive characters flutter path vector_math] - month_picker_dialog 0.4.0 [flutter flutter_localizations intl rxdart] - page_transition 2.0.2 [flutter] - shared_preferences 2.0.6 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - shimmer 2.0.0 [flutter] - signature 4.1.1 [flutter image] - splashscreen 1.4.0 [flutter] dev dependencies: - change_app_package_name 1.0.0 - flutter_launcher_icons 0.9.0 [args image path yaml] - flutter_native_splash 1.1.8+4 [image meta path xml yaml universal_io] - import_sorter 4.6.0 [args tint yaml] - lint 1.5.3 transitive dependencies: - archive 3.1.2 [crypto path] - args 2.0.0 - async 2.6.1 [meta collection] - boolean_selector 2.1.0 [source_span string_scanner] - characters 1.1.0 - charcode 1.2.0 - clock 1.1.0 - collection 1.15.0 - connectivity_for_web 0.4.0 [connectivity_platform_interface flutter_web_plugins flutter] - connectivity_macos 0.2.0 [flutter] - connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - crypto 3.0.1 [collection typed_data] - csv 5.0.0 - easy_logger 0.0.2 [flutter] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase 9.0.1 [http http_parser js] - firebase_analytics_platform_interface 2.0.1 [flutter meta] - firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.1.0 [collection firebase_core flutter meta plugin_platform_interface] - flare_flutter 3.0.1 [collection flutter meta] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - flutter_spinkit 5.0.0 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.0.2 [archive meta xml] - intl 0.17.0 [clock path] - js 0.6.3 - matcher 0.12.10 [stack_trace] - meta 1.3.0 - path 1.8.0 - path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.11.1 - petitparser 4.1.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.1 [meta] - process 4.2.1 [file path platform] - rxdart 0.26.0 - shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows] - simple_animations 3.1.1 [flutter supercharged pedantic] - sky_engine 0.0.99 - source_span 1.8.1 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - string_scanner 1.1.0 [charcode source_span] - supercharged 2.0.0 [supercharged_dart flutter] - supercharged_dart 2.0.0 - term_glyph 1.2.0 - test_api 0.3.0 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - tint 2.0.0 - typed_data 1.3.0 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - vector_math 2.1.0 - win32 2.2.5 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.2 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

Piero512 commented 3 years ago

I too also experience the missing header.

fedpinx commented 3 years ago

Me too. Please help! We need to deploy to prod soon :)

rwrz commented 3 years ago

Workaround:

Edit this file:

Change the version to 8.2.0.

It should work to deploy it to production. But it is just a temporary thing, next time you update the firebase_core or clear your build, it should reset again.

PS.: I tried with the latest version 8.3.1 but it didn't work.

SarvagyaVaish commented 3 years ago

Any ideas on how we can implement this hack for building on Bitrise?

fedpinx commented 3 years ago

Any ideas on how we can implement this hack for building on Bitrise?

Basically, ios/.symlinks/plugins/firebase_core/ios/firebase_sdk_version.rb content is:

def firebase_sdk_version!()
  '8.0.0'
end

I would say right after pod install replace that file content with:

def firebase_sdk_version!()
  '8.2.0'
end

and let CD continue, not sure if I helped but that's what I did with fastlane and github actions.

masewo commented 3 years ago

@rwrz Can you define "clear your build"? I tried your solution on my M1 but still no success. I use flutter clean but the firebase_sdk_version.rb keeps on 8.2.0.

thegrxp commented 3 years ago

Until it's fixed I've downgraded the firebase_crashlytics version

flutter pub downgrade firebase_crashlytics

abhinavsingh commented 3 years ago

Why announce a new release when integration is so deeply broken :(. Inability to build iOS releases in an ongoing project is just unnecessary distraction on a good Friday

MedvedevAI commented 3 years ago

Until it's fixed I've use firebase_crashlytics: 2.0.7 firebase_analytics: 8.1.2

abhinavsingh commented 3 years ago

Until it's fixed I've use firebase_crashlytics: 2.0.7 firebase_analytics: 8.1.2

Don't think that alone will fix it for everyone. Real issue (imho) is upgrade to Firebase iOS SDK 8.3.0 dependency. This change happened on July 12th, even the build was broken, but no one seem to have cared about it. See change history here https://github.com/FirebaseExtended/flutterfire/commits/master/packages/firebase_core/firebase_core/ios/firebase_sdk_version.rb

To fix at our end, we simply changed:

firebase_core: ^1.1.0 to firebase_core: 1.3.0

Infact we have now pinned versions in our apps, to avoid such surprises in the future. Upgrade when you wish to in future explicitly, not via some unknown magic.

  firebase_core: 1.3.0
  firebase_analytics: 8.1.2
  firebase_crashlytics: 2.0.6
  firebase_performance: 0.7.0+5
  firebase_messaging: 10.0.2

To ensure changes take effect: 1) Comment all dependencies in pubspec.yaml 2) pub get 3) Uncomment dependencies 4) pub get 5) Run pod install 6) If necessary, delete Podspec.lock file and try pod install again

Hope this helps.

Zeswen commented 3 years ago

Same problem here. Downgrading firebase_crashlytics to 2.0.7 in pubspec.lock seems to solve the problem temporarely.

george-dobrin commented 3 years ago

I confirm that downgrading firebase_core version to 1.3.0 from ^1.3.0 solves the error.

pureimpro commented 3 years ago

same here with codemagic CI/CD. I have changed firebase_crashlytics from ^2.0.7 to '>=2.0.7 <2.1.0 in pubspec.yaml to make my app compile

russellwheatley commented 3 years ago

Hey folks, we have a fix coming down the pipeline vey soon. We use the Crashlytics example app to test builds and it passed our CI. We tested against a fresh Flutter app and the build failed, as has been reported. We diff'd the Podfile between our Crashlytics example app and a fresh Flutter app and found these two additional config settings which made the difference in where the correct Analytic's code was placed:

target 'Runner' do
  # These two below
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Not sure why the Podfiles are different at this moment in time but we have found a solution, and it will be released soon.

pureimpro commented 3 years ago

Hey folks, we have a fix coming down the pipeline vey soon. We use the Crashlytics example app to test builds and it passed our CI. We tested against a fresh flutter app and the build failed, as has been reported. We diff'd the Podfile between our Crashlytics example app and a fresh Flutter app and found these two additional config setting which made the difference in were the correct Analytics code was placed:

target 'Runner' do
  # These two below
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Not sure why the Podfiles are different at this moment in time but we have found a solution, and it will be released soon.

Hi @russellwheatley, not sure that this is a workaround since this is the exact config of my PodFile. I already had both use_frameworks! and use_modular_headers! in it and I had to update pubspec.yaml to disable 2.1.0 of firebase_crashlytics. Works fine with 2.0.7

russellwheatley commented 3 years ago

@pureimpro, that isn't the workaround.

pureimpro commented 3 years ago

ok @russellwheatley, we stay tuned for the fix. Thanks for your help

russellwheatley commented 3 years ago

Please update to the latest Crashlytic's version (2.1.1) in your pubspec.yaml and your app should build appropriately. Sorry for the inconvenience 👍.

SarvagyaVaish commented 3 years ago

I updated my pubspec to have the following and that fixed it. I got these versions by looking at the version pages for these packages and selecting the releases made before July 15th. For example 2.0.0 for firebase_auth.

  firebase_core: 1.3.0
  firebase_analytics: 8.1.2
  firebase_auth: 2.0.0
  firebase_crashlytics: 2.0.7
  firebase_dynamic_links: 2.0.6
ToniTornado commented 3 years ago

Only updating the version in my pubspec.yaml did not solve the issue. But it is now finally working for me with these versions:

  firebase_core: ^1.4.0
  firebase_crashlytics: ^2.1.1
  firebase_analytics: ^8.2.0

I had run flutter clean, delete Podfile.lock and I deleted my ~/.pub-cache folder until it finally stopped giving me that error - not sure what exact step made my Podfile.lock update correctly.

KristianBalaj commented 3 years ago

I'm still getting the following error:

/Users/kristian/Documents/Kristian/bottleshop/bottleshop_delivery_app/ios/Pods/FirebaseCrashlytics/Crashlytics/Crashlytics/Controllers/FIRCLSAnalyticsManager.h:17:9: fatal error: 'Interop/Analytics/Public/FIRAnalyticsInterop.h' file not found
    #import "Interop/Analytics/Public/FIRAnalyticsInterop.h"

Having the pubspec as following:

firebase_core: ^1.4.0
firebase_messaging: ^10.0.4
firebase_auth: ^3.0.1
cloud_firestore: ^2.4.0
firebase_crashlytics: ^2.1.1
firebase_analytics: ^8.2.0
firebase_storage: ^10.0.1
cloud_functions: ^3.0.0

I tried to flutter clean, deleting build, Podfile.lock, Pods, .symlinks and the ~/.pub-cache, too.

Do you have any tips?