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.71k stars 3.97k forks source link

🐛 [firebase_analytics] error: no known class method for selector 'setScreenName:screenClass:' #6209

Closed juanagu closed 3 years ago

juanagu commented 3 years ago

Bug report

Describe the bug The build process fails for iOS.

Steps to reproduce

Steps to reproduce the behavior:

  1. Try to run the app for iOS
  2. See error or incorrect behavior in the console

Additional context

XCode Version: Version 12.4 (12D4e) Pod Version: 1.10.1

Firebase dependencies:

 #firebase
  firebase_crashlytics: 2.0.0
  firebase_analytics: "^7.0.1"
  firebase_performance: 0.6.0+2
  firebase_remote_config: 0.9.0-dev.2
  firebase_core: ^1.0.3
  firebase_in_app_messaging: 0.5.0`

Error:

firebase_analytics-7.1.1/ios/Classes/FLTFirebaseAnalyticsPlugin.m:49:19: error: no known class method for selector 'setScreenName:screenClass:'
        [FIRAnalytics setScreenName:screenName screenClass:screenClassOverride];
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '10.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
          '$(inherited)',

          ## dart: PermissionGroup.calendar
          'PERMISSION_EVENTS=0',

          ## dart: PermissionGroup.reminders
          'PERMISSION_REMINDERS=0',

          ## dart: PermissionGroup.contacts
           'PERMISSION_CONTACTS=0',

          ## dart: PermissionGroup.camera
          'PERMISSION_CAMERA=0',

          ## dart: PermissionGroup.microphone
          'PERMISSION_MICROPHONE=0',

          ## dart: PermissionGroup.speech
          'PERMISSION_SPEECH_RECOGNIZER=0',

          ## dart: PermissionGroup.photos
          'PERMISSION_PHOTOS=0',

          ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
         'PERMISSION_LOCATION=0',

          ## dart: PermissionGroup.notification
          'PERMISSION_NOTIFICATIONS=0',

          ## dart: PermissionGroup.mediaLibrary
          'PERMISSION_MEDIA_LIBRARY=0',

          ## dart: PermissionGroup.sensors
          'PERMISSION_SENSORS=0',

          ## dart: PermissionGroup.bluetooth
          'PERMISSION_BLUETOOTH=0'
        ]  
    end
  end
end

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [✓] Flutter (Channel stable, 2.0.2, on macOS 11.1 20C69 darwin-x64, locale en-PL) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] VS Code (version 1.56.2) [✓] 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.12.1 Flutter SDK 2.0.2 app 0.14.4 dependencies: - brand_feed 0.0.1 [flutter visibility_detector scrollable_positioned_list flutter_slidable flutter_bloc freezed_annotation dartz equatable flutter_icons readmore commons core connect delete_connected_items post_detail] - campaign_detail 0.0.1 [flutter flutter_bloc flutter_icons readmore commons core carousel_slider url_launcher] - campaign_hide 0.0.1 [dartz flutter flutter_icons flutter_bloc core commons] - carousel_slider 3.0.0 [flutter] - charts_flutter 0.10.0 [charts_common collection flutter intl logging meta] - commons 0.0.1 [flutter firebase_crashlytics firebase_analytics firebase_performance firebase_remote_config firebase_core dio dio_cache_interceptor sqlite3_flutter_libs dio_cookie_manager get_it shared_preferences path_provider equatable event_bus url_launcher] - core 0.0.1 [flutter hive hive_flutter mobx flutter_mobx flutter_icons flutter_bloc webview_flutter floating_action_bubble auto_size_text flutter_staggered_grid_view cached_network_image google_nav_bar pull_to_refresh material_floating_search_bar dropdown_search charts_flutter intl_phone_number_input flutter_svg flutter_facebook_login json_annotation equatable provider screenshot path_provider permission_handler pdf share printing connectivity shimmer commons] - delete_connected_items 0.0.1 [flutter core dartz flutter_bloc] - equatable 2.0.0 [collection meta] - firebase_analytics 7.1.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta] - firebase_core 1.2.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.0.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_in_app_messaging 0.5.0 [firebase_core flutter meta] - firebase_performance 0.6.0+2 [firebase_core flutter] - firebase_remote_config 0.9.0-dev.2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface flutter] - floating_action_bubble 1.1.2 [flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_icons 2.0.0 [flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - flutter_mobx 2.0.0 [flutter mobx] - flutter_slidable 0.6.0 [flutter] - flutter_staggered_grid_view 0.3.4 [flutter] - hive 2.0.4 [meta crypto] - hive_flutter 1.0.0 [flutter hive path_provider path] - intercom_integration 0.0.1 [flutter intercom_flutter flutter_icons] - intl 0.17.0 [clock path] - json_annotation 3.0.0 - keyboard_actions 3.4.0 [flutter] - mobx 2.0.1 [meta] - onboarding 0.0.1 [dartz flutter flutter_bloc flutter_svg freezed_annotation core commons] - path_provider 2.0.1 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - pdf 3.2.0 [archive barcode crypto image meta path_parsing vector_math xml] - printing 5.0.4 [ffi flutter flutter_web_plugins image js meta pdf plugin_platform_interface] - provider 5.0.0 [collection flutter nested] - readmore 1.0.1 [flutter] - screenshot 0.3.0 [flutter] - share 2.0.1 [meta mime flutter] - smartlook_integration 0.0.1 [flutter smartlook] - trending 0.0.1 [flutter chips_input flutter_icons visibility_detector scrollable_positioned_list flutter_bloc freezed_annotation dartz equatable async core commons post_detail flutter_svg] - visibility_detector 0.2.0 [flutter] - wait_list_locker 0.0.1 [dotted_line flutter flutter_svg flutter_bloc freezed_annotation dartz equatable flutter_icons commons core] - webview_flutter 2.0.4 [flutter] dev dependencies: - build_runner 1.12.2 [args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style glob graphs http_multi_server io js logging meta mime path pedantic pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - dart_countries_states 0.1.1 [built_collection built_value http logger] - faker 1.3.0 - flutter_driver 0.0.0 [file meta path vm_service webdriver flutter flutter_test fuchsia_remote_debug_protocol archive args async boolean_selector characters charcode clock collection convert crypto fake_async matcher platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - flutter_launcher_icons 0.9.0 [args image path yaml] - 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] - http_mock_adapter 0.2.1 [dio mockito] - integration_test 0.9.2+2 [flutter flutter_driver flutter_test path vm_service archive args async boolean_selector characters charcode clock collection convert crypto fake_async file matcher meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver] - mockito 5.0.3 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] dependency overrides: - archive 2.0.13 [crypto args path] - args 2.0.0 - convert 2.1.1 [charcode typed_data] - crypto 2.1.5 [collection convert typed_data] - intl 0.17.0 [clock path] - json_annotation 3.0.0 transitive dependencies: - _fe_analyzer_shared 20.0.0 [meta] - analyzer 1.4.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml pedantic] - async 2.5.0 [collection] - auto_size_text 2.1.0 [flutter] - barcode 2.1.0 [meta qr] - bloc 7.0.0 [meta] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.0.0 [analyzer async convert crypto glob logging meta path] - build_config 0.4.7 [checked_yaml json_annotation meta path pubspec_parse yaml] - build_daemon 2.1.10 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.0.0 [analyzer build crypto graphs logging path package_config pool pub_semver stream_transform] - build_runner_core 6.1.12 [async build build_config build_resolvers collection convert crypto glob graphs logging meta path package_config pedantic pool timing watcher yaml] - built_collection 5.0.0 - built_value 8.0.4 [built_collection collection fixnum] - cached_network_image 3.0.0 [flutter flutter_cache_manager octo_image] - characters 1.1.0 - charcode 1.2.0 - charts_common 0.10.0 [collection intl logging meta vector_math] - checked_yaml 2.0.1 [json_annotation source_span yaml] - chips_input 0.0.5 [flutter] - cli_util 0.3.0 [meta path] - clock 1.1.0 - code_builder 3.7.0 [built_collection built_value collection matcher meta] - collection 1.15.0 - connect 0.0.1 [flutter flutter_bloc flutter_slidable freezed_annotation dartz flutter_icons commons core delete_connected_items] - connectivity 3.0.3 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - 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] - cookie_jar 3.0.1 - dart_style 2.0.0 [analyzer args path pub_semver source_span] - dartz 0.9.2 - dio 4.0.0 [http_parser path] - dio_cache_interceptor 2.3.1 [dio hive moor path uuid] - dio_cookie_manager 2.0.0 [cookie_jar dio] - dotted_line 3.0.0 [flutter] - dropdown_search 0.5.0 [flutter] - event_bus 2.0.0 - fake_async 1.2.0 [clock collection] - ffi 1.0.0 - file 6.0.0 [meta path] - firebase 9.0.1 [http http_parser js] - firebase_analytics_platform_interface 1.1.0 [flutter meta] - firebase_analytics_web 0.2.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.0.4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_platform_interface 0.2.0-dev.1 [firebase_core flutter meta plugin_platform_interface] - fixnum 1.0.0 - flutter_bloc 7.0.0 [flutter bloc provider] - flutter_blurhash 0.6.0 [flutter meta pedantic] - flutter_cache_manager 3.0.1 [clock collection file flutter http image path path_provider pedantic rxdart sqflite uuid] - flutter_facebook_login 3.0.0 [flutter collection] - flutter_svg 0.21.0+1 [flutter meta path_drawing vector_math xml] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - freezed_annotation 0.12.0 [collection json_annotation meta] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - get_it 6.0.0 [async collection] - glob 2.0.1 [async collection file path pedantic string_scanner] - google_nav_bar 5.0.3 [flutter] - graphs 1.0.0 - http 0.13.1 [http_parser meta path pedantic] - http_multi_server 2.2.0 [async] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.0.2 [archive meta xml] - intercom_flutter 3.1.0 [flutter] - intl_phone_number_input 0.7.0+1 [flutter meta libphonenumber_plugin equatable collection] - io 0.3.4 [charcode meta path string_scanner] - js 0.6.3 - libphonenumber 2.0.0 [flutter meta] - libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface] - libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber] - libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface] - logger 1.0.0 - logging 1.0.1 - matcher 0.12.10 [stack_trace] - material_floating_search_bar 0.3.3 [flutter meta] - meta 1.3.0 - mime 1.0.0 - moor 4.2.1 [async convert collection meta pedantic stream_channel sqlite3] - nested 1.0.0 [flutter] - octo_image 1.0.0+1 [flutter flutter_blurhash] - package_config 2.0.0 [path] - path 1.8.0 - path_drawing 0.5.0 [vector_math meta path_parsing flutter] - path_parsing 0.2.0 [vector_math meta] - path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 2.0.0 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.0 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.11.0 - permission_handler 6.1.3 [flutter meta permission_handler_platform_interface] - permission_handler_platform_interface 3.2.0 [flutter meta plugin_platform_interface] - petitparser 4.1.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.0 [meta] - pool 1.5.0 [async stack_trace] - post_detail 0.0.1 [flutter flutter_bloc commons core dartz freezed_annotation readmore] - process 4.0.0 [file path platform] - pub_semver 2.0.0 [collection] - pubspec_parse 1.0.0 [checked_yaml collection json_annotation pub_semver yaml] - pull_to_refresh 1.6.4 [flutter] - qr 2.0.0 [meta] - rxdart 0.26.0 - scrollable_positioned_list 0.1.10 [flutter meta] - shared_preferences 2.0.5 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - 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] - shelf 1.1.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 0.2.4+1 [shelf stream_channel web_socket_channel] - shimmer 1.1.2 [flutter] - sky_engine 0.0.99 - smartlook 1.0.7 [flutter] - source_gen 1.0.0 [analyzer async build dart_style glob meta path pedantic source_span] - source_span 1.8.0 [charcode collection path term_glyph] - sqflite 2.0.0+3 [flutter sqflite_common path] - sqflite_common 2.0.0+2 [synchronized path meta] - sqlite3 1.0.0 [collection ffi meta] - sqlite3_flutter_libs 0.4.1 [flutter] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - sync_http 0.2.0 - synchronized 3.0.0 - term_glyph 1.2.0 - test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - timing 0.1.1+3 [json_annotation] - typed_data 1.3.0 [collection] - url_launcher 6.0.3 [flutter url_launcher_platform_interface url_launcher_linux url_launcher_macos url_launcher_windows url_launcher_web] - url_launcher_linux 2.0.0 [flutter] - url_launcher_macos 2.0.0 [flutter] - url_launcher_platform_interface 2.0.1 [flutter plugin_platform_interface] - url_launcher_web 2.0.0 [url_launcher_platform_interface meta flutter flutter_web_plugins] - url_launcher_windows 2.0.0 [flutter] - uuid 3.0.4 [crypto] - vector_math 2.1.0 - vm_service 5.5.0 [meta] - watcher 1.0.0 [async path pedantic] - web_socket_channel 1.1.0 [async crypto stream_channel] - webdriver 2.1.2 [archive matcher path stack_trace sync_http] - win32 2.0.5 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.0 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

darshankawar commented 3 years ago

@juanagu Closing this as duplicate of https://github.com/FirebaseExtended/flutterfire/issues/6201. Please try with latest version and follow-up in the linked issue for updates.

Also, you may want to update your stable version to latest.