LoginSignup
1
1

More than 5 years have passed since last update.

React Native Firebase が Carthage を認識してくれない

Last updated at Posted at 2018-10-11

概要

  • Carthage を使って firebase-ios-sdk を入れた
  • インストールとビルドは成功した
  • react-native-firebase で認識してくれなくて、詰んだ

解決策

素直に Cocoapods を使う

試した手順

https://github.com/firebase/firebase-ios-sdk/blob/master/Carthage.md を参考に、SDKを入れる

  • Cartfile に記述
Cartfile
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json"
  • インストール
carthage update
  • Carthage/Build/iOS/*.framework ファイルを手動でFrameworksに追加する
  • 起動する
  • 次のコードを App.js などに記載
import firebase from 'react-native-firebase'

firebase
  .auth()
  .signInAnonymously()
  .then(credential => {
    if (credential) {
      console.log('default app user ->', credential.user.toJSON())
    }
  })

Native でインストールしてないから、 pod install しろと怒られる。

Native にインストールできている証拠としては、 AppDelegate.m に Firebase 関連のコードを書いた時は、うまく動いている。

他にも色々なことを試したが、結局うまくいかなかった。 Cocoapods 親切すぎるのであまり使いたくないのだが、特に React Native の場合は Cocoapods から変えないほうが時間の節約になるということを学んだ。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1