React-native-firebase: Build fails on RN 0.52 after running "react-native link react-native-firebase"

Created on 3 Feb 2018  Â·  13Comments  Â·  Source: invertase/react-native-firebase

Environment

Target Platform (e.g. iOS, Android): iOS
Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra 10.13.2
Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Xcode, iOS 11.2

React Native version (e.g. 0.45.1): 0.52.2
RNFirebase Version (e.g. 2.0.2): ^3.2.4

After running react-native link react-native-firebase and trying to run react-native run-ios I get build errors.

The following build commands failed:

CompileC /Users/jonpucxyz/Documents/Apps/project\ green/react-native/greenwah/ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAdMobRewardedVideo.o RNFirebase/admob/RNFirebaseAdMobRewardedVideo.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC /Users/jonpucxyz/Documents/Apps/project\ green/react-native/greenwah/ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAuth.o RNFirebase/auth/RNFirebaseAuth.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Build Error iOS Waiting for User Response

Most helpful comment

Having a very similar issue. None of the aforementioned advice is helping me.

ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseFunctions.o RNFirebase/functions/RNFirebaseFunctions.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

All 13 comments

Try the following in xcode:

1) Do product > clean
2) Close Xcode
3) Re-run pod install (from the command line)
4) Re-open the .xcworkspace
5) Do product > clean
6) Try a build

@chrisbianca Working. Thank you!

I followed the steps but I got a fail...
At my ios directory, I don't have pod files to install... What's wrong?

I got the same error:

** BUILD FAILED **


The following build commands failed:

    CompileC /MyApp/ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAdMobRewardedVideo.o RNFirebase/admob/RNFirebaseAdMobRewardedVideo.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC /MyApp/ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAuth.o RNFirebase/auth/RNFirebaseAuth.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Adding the Firebase SDK manually without using Cocoapods as explained here

All I have done is following the Steps of the Initial Installation:

  • npm install --save react-native-firebase

Than the ones specific for iOS:

  • Adding #import <Firebase.h> at the top of AppDelegate.m
  • Adding [FIRApp configure]; at the beginning of didFinishLaunchingWithOptions:(NSDictionary *)launchOptions within the same file

Than adding the Firebase SDK Files, namely all Frameworks in the Analytics Sub Directory of the SDK and the Firebase.h file. Frameworks of the Analytics Subdirectory are the Following:

  • FirebaseAnalytics.framework
  • FirebaseCore.framework
  • FirebaseCoreDiagnostics.framework
  • FirebaseInstanceID.framework
  • FirebaseNanoPB.framework
  • GoogleToolboxForMac.framework
  • nanopb.framework

I have added them to the right target within XCode and made sure as well to copy files if needed. The -ObjC flag is set as well under Build Settings.

Last but not least I executed react-native link react-native-firebase

Not sure why its complaining about Admob.

Okay, this is probably related to #1061. The Integrate without CocoaPods guide automatically downloads the latest version. Would love if somebody could point me into the right direction on where to get the 4.13.0 files from to integrate the SDK manually. The one from the firebase-ios-sdk repository only contains a subset of the source. Related: https://github.com/firebase/firebase-ios-sdk/issues/1270

Found the download link for 4.13.0 via @Salakar on discord: https://dl.google.com/firebase/sdk/ios/4_13_0/Firebase-4.13.0.zip

This was definitely related to the newest release, after doing the same steps with the 4.13.0 files the build succeeds.

I am still facing the same problem :( ..

The following commands produced analyzer issues:
        Analyze Base/RCTModuleMethod.mm normal x86_64
(1 command with analyzer issues)

The following build commands failed:

CompileC /Users/<project folder>/ios/build/Build/Intermediates/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAdMobRewardedVideo.o RNFirebase/admob/RNFirebaseAdMobRewardedVideo.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

even with 4.13.0.

I am using:

"react-native": "^0.55.4",
"react-native-firebase": "^4.3.7",

Any suggestion? @jaschaio and @jonathanpuc @chrisbianca ? Actually, I tried both pod method and non-pod method and both is failing :(

I have an extremely similar issue, and the advice to clean does not help:

CompileC /Users/<path-to-project>/ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAnalytics.o RNFirebase/analytics/RNFirebaseAnalytics.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
  • Also on RN 0.52
  • Followed the "pods" installation process given by firebase console

Strangely this seems to have no impact on the actual performance of the app - react-native chugs right through and still installs on the iPhone simulator, and the firebase functionality even works as intended. However, the build technically "fails" which will prevent my ability to release to non-dev environments.

Oh I actually solved it for myself! For posterity:

The cause was a version-matching mistake, which seems a common issue using react-native-firebase. I continually need to refer back to the chart available in the README and re-do all my versions to make sure everything is matching.

In my case, I was using Firebase IOS SDK version 5.3 in all my podfiles, but being a 0.52 RN project means I need to use Firebase IOS SDK version 4.7.0.

I chose _not_ to leave the version ambiguous in the Podfile, as recommended by firebase. I specify with syntax like 'Firebase/Core', '~> 4.7.0'

Keeping versions straight through this process has been a nightmare, but it's paramount. I wish documentation stressed this more. It's finally working though.

If you follow the troubleshoot of @lancedolan but still can't make it work, try the following (drastic and potentially unfeasible measure):

  1. Copy the Podfile, build.gradle, GoogleService-Info.plist, and google-services.json files into another folder.
  2. Completely remove the ios and android folder.
  3. Recreate said folders, by running react-native upgrade (you can downgrade to your preferred versions after this again)
  4. Recreate the ios (or android) project again with e.g. pod install and react-native link react-native-firebase
  5. Try building your app with e.g. react-native run-ios.

I realise that this is a quite drastic move, but it helped me, so maybe it will help you to!

Edit: Alternatively, I heard that others were able to fix these build issues by not using cocoapods or react-native link react-native-firebase, but rather integrate the Firebase library manually

Edit 2: Also, make sure to run pod update before running pod install when you set up your project.

Edit 3: For some people it helped to delete the /ios/build folder and then try to build the project again.

Edit 4: Try setting the Build System back to Legacy in Xcode. You can do that in File > Workspace Settings.

Having a very similar issue. None of the aforementioned advice is helping me.

ios/build/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseFunctions.o RNFirebase/functions/RNFirebaseFunctions.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

@lancedolan
I am getting the same error.

Installing the library manually :
https://rnfirebase.io/docs/v5.x.x/installation/ios#1.3.-Install-Firebase-Library
https://github.com/invertase/react-native-firebase/issues/1847#issuecomment-457952828

"react-native-firebase": "^5.3.1",
Download the latest version (6.0.1) from
https://firebase.google.com/support/releases

Could you help me with the links to download the previous version≥

Error
CompileC /Users/<path_to_project>/ios/build/AlrajhiRetailApp/Build/Intermediates.noindex/RNFirebase.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseAnalytics.o RNFirebase/analytics/RNFirebaseAnalytics.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

@ashish9342 Download the latest version (6.0.1) from

v6.0.0 of the iOS SDK is not supported, you'll need a version between v5.19.x to v5.20.2 as documented on the version compatibility table:

image

If you continue to have issues after this please make a new GitHub issue thanks.

Was this page helpful?
0 / 5 - 0 ratings