Skip to content

Allows react-native-firebase to be used via Podfile with use_frameworks! #2235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2019
Merged

Allows react-native-firebase to be used via Podfile with use_frameworks! #2235

merged 1 commit into from
Jun 23, 2019

Conversation

MoOx
Copy link

@MoOx MoOx commented Jun 14, 2019

Ref #252 (comment)

Checklist

  • Supports Android
  • Supports iOS
  • e2e tests added or updated in /tests/e2e/*
  • Updated the documentation in the docs repo
  • Flow types updated
  • Typescript types updated

Test Plan

I tested this like that:

Release Plan

[IOS][BUGFIX] [ios/RNFirebase.podspec] - Allows react-native-firebase to be used via Podfile with use_frameworks!


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@CLAassistant
Copy link

CLAassistant commented Jun 14, 2019

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jun 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (v5.x.x@9bf9fa1). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             v5.x.x    #2235   +/-   ##
=========================================
  Coverage          ?   76.27%           
=========================================
  Files             ?       61           
  Lines             ?     1576           
  Branches          ?        0           
=========================================
  Hits              ?     1202           
  Misses            ?      374           
  Partials          ?        0

@mikehardy
Copy link
Collaborator

Thanks for this! The podspec is obviously fundamental to the project so I need to very carefully test this one out, but I appreciate the PR, and if it fixes (at minimum) our header search path issues, oh man that will be helpful :-)

@MoOx
Copy link
Author

MoOx commented Jun 14, 2019

@mikehardy take your time, my trick referenced is perfect & enough for me atm.

@cmcewen
Copy link
Contributor

cmcewen commented Jun 16, 2019

Just wanted to say I tried this out and it worked for me as well. Thanks @MoOx!

@mikehardy
Copy link
Collaborator

I appreciate the success report, thank you for testing and reporting back

Copy link
Contributor

@Salakar Salakar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me, the impact is only Pods users, so won't need to test out non-pods behaviour here at least.

If this works in the tests app with all modules enabled then this should be good to go 👍

@mikehardy mikehardy added this to the v5.5.x milestone Jun 23, 2019
@mikehardy mikehardy merged commit b85153d into invertase:v5.x.x Jun 23, 2019
@mikehardy
Copy link
Collaborator

This should be in 5.5.4 - thanks @MoOx !

@martintreurnicht
Copy link

@MoOx You are a champ my friend, this saved me so much time!

@mikehardy
Copy link
Collaborator

released 5.5.4 with use_frameworks support today!

@namvoeh
Copy link

namvoeh commented Jul 3, 2019

I got this error after upgrading to 5.5.4, my project has use_framework!

▸ Compiling RNFirebaseInstanceId.m
▸ Compiling RNFirebaseAdMobRewardedVideo.m
▸ Compiling RCTConvert+UIBackgroundFetchResult.m
▸ Compiling RNFirebaseAdMob.m
▸ Compiling RNFirebaseLinks.m
▸ Compiling RNFirebaseFirestoreCollectionReference.m
** ARCHIVE FAILED **


The following build commands failed:
CompileC /Users/distiller/Library/Developer/Xcode/DerivedData/EHLife-gjmlboqelaiuboeparmweacbgttk/Build/Intermediates.noindex/ArchiveIntermediates/EHLife/IntermediateBuildFilesPath/RNFirebase.build/Release\ Staging-iphoneos/RNFirebase.build/Objects-normal/armv7/RNFirebaseAdMobRewardedVideo.o RNFirebase/admob/RNFirebaseAdMobRewardedVideo.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

@MoOx MoOx deleted the v5-fix-podfile branch July 3, 2019 06:34
@MoOx
Copy link
Author

MoOx commented Jul 3, 2019

I just tried & didn't get any issue while creating an archive via Xcode.

Here is my podfile (cleaned to keep firebase stuff only as I have things I cannot share)

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
swift_version = '4.2'

target 'ADM' do
  use_frameworks!

  # React-Native
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTBlob',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]
  # React-Native dependencies
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Firebase
  pod 'Firebase', '~> 5.20.0'
  pod 'Firebase/Core', '~> 5.20.0'
  pod 'Firebase/Analytics', '~> 5.20.0'
  pod 'Firebase/DynamicLinks', '~> 5.20.0'
  pod 'Firebase/Messaging', '~> 5.20.0'

  # React-Native libraries
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
end

post_install do |installer|
  # see also ios/fastlane/Fastfile 'compileBitcode' option for fastlane
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Note here that I removed private stuff that are not interesting. I just kept the last part which is mandatory for me as I have some other deps that can't work with ENABLE_BITCODE.
Maybe you can try this & see if this change a thing?

@namvoeh
Copy link

namvoeh commented Jul 3, 2019

@MoOx cause you are using pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios' to setup react-native-firebase, I am using another way which is recommended https://rnfirebase.io/docs/v5.x.x/installation/ios#Option-1:-Link-React-Native-Firebase-(Recommended)

your current way is not recommended according to https://rnfirebase.io/docs/v5.x.x/installation/ios#Option-2:-Cocoapods-(Not-Recommended)

@MoOx
Copy link
Author

MoOx commented Jul 3, 2019

@namvoeh this might become the new recommended approach, see #2223 (comment)

If you don't use RNFirebase from podfile, I don't see how the change in this PR might affect you. Podfile is only used when using the method I used, that you seems not to use.

@namvoeh
Copy link

namvoeh commented Jul 3, 2019

you are right. Moreover, RN 0.60 will support cocoapods integration by default https://github.com/facebook/react-native/releases/tag/v0.60.0-rc.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants