relateddigital / react-native-related-digital

Mobile notifications and analytics
https://www.relateddigital.com
30 stars 1 forks source link

Build error with Firebase Analytics & Crashlytics #8

Closed oguzydz closed 9 months ago

oguzydz commented 9 months ago

Description

When I want to use with Firebase Analytics & Crashlytics, there could be hermes compatible issue. Firsty, I added messaging and app libraries, I can handle with adding pod files manually.

pod 'Firebase', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true pod 'FirebaseCore', :modular_headers => true

However, with crashlytics and analytics I cannot find pod file which I can add manually to podfile.

Build output

SwiftEmitModule normal arm64 Emitting\ module\ for\ FirebaseSessions (in target 'FirebaseSessions' from project 'Pods')

Libraries

"@react-native-firebase/analytics": "^17.3.2", "@react-native-firebase/app": "^17.3.2", "@react-native-firebase/crashlytics": "^17.3.2", "react-native-related-digital": "^1.0.7",

System Info

System: OS: macOS 13.4.1 CPU: (10) arm64 Apple M2 Pro Memory: 91.30 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.16.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 9.6.7 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 28, 29, 30, 31, 33 Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0 System Images: android-26 | ARM 64 v8a, android-28 | Intel x86 Atom_64, android-29 | Intel x86 Atom, android-29 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play ARM 64 v8a, android-30 | ARM 64 v8a, android-30 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9862592 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.11 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.3 => 0.71.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

bariisarslans commented 9 months ago

Hi,

Could you add the following lines to your podfile and try again?

pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseSessions', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
pod 'FirebaseInstallations', :modular_headers => true
pod 'GoogleDataTransport', :modular_headers => true
pod 'nanopb', :modular_headers => true
pod 'react-native-related-digital', :path => '../node_modules/react-native-related-digital', :modular_headers => true

In the end, your podfile should look like this:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
prepare_react_native_project!

pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseSessions', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
pod 'FirebaseInstallations', :modular_headers => true
pod 'GoogleDataTransport', :modular_headers => true
pod 'nanopb', :modular_headers => true
pod 'react-native-related-digital', :path => '../node_modules/react-native-related-digital', :modular_headers => true

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'example' do
  config = use_native_modules!

  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => flipper_config,
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end