During the Invertase Firebase Crashlytics setup (https://rnfirebase.io/crashlytics/ios-setup) , I continuously get the the following error:
CocoaPods could not find compatible versions for pod "Firebase/Crashlytics"
Or other variant relating to Firebase/Core or Firebase/CoreOnly
Podfile
pod 'Firebase/Core'
pod 'Firebase/CoreOnly'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
Even if I try to set each package to a specific version with ~> 6.x.x
related node modules
"#react-native-firebase/app": "^6.7.1",
"#react-native-firebase/crashlytics": "^6.7.1",
"#react-navigation/native": "^5.1.6",
react-native-firebase supports lib auto-link, which means you don't need to add
Firebase pods in Podfile manually
duan response worked for me, at least i have no errors
also, i linked this manually:
react-native link #react-native-firebase/crashlytics
Related
I use Swift Frameworks (Cocoa Touch Framework) to segment code into fairly independent modules.I have imported several external libraries, with Cocoapods, into the main app and those modules without any issues so far.
Xcode 9.3
iOS 11.2
CocoaPods 1.5
GoogleToolboxForMac (2.1.3), Firebase (4.13.0), FirebaseAnalytics (4.2.0), FirebaseCore (4.0.20), FirebaseDatabase (4.1.5), FirebaseInstanceID (2.0.10)
However when I import Firebase in any of those modules, in addition to importing it in the main app, my application crashes.
I don't even need to use anything from Firebase in the modules ; simply adding the pod to the target (module Store in this case) in the Podfile will crash the app as soon as I leave the main window (fira_viewDidDisappear).
There is also a long list of issues during startup (that were also reported by others), all similar to :
objc[36264]: Class FIRAIdentifiers is implemented in both /{$userdir}/Library/Developer/Xcode/DerivedData/FrameWork101-aekmajbumgzabmayoanlcrwtzbcs/Build/Products/Debug-iphonesimulator/Store.framework/Store (0x105478318) and /{$userdir}/Library/Developer/CoreSimulator/Devices/31D920E9-CD46-47C4-9631-503B3471AAF7/data/Containers/Bundle/Application/57B8020D-E2AB-4A06-B654-5F26F8E00AF6/FrameWork101.app/FrameWork101 (0x103b1ef80). One of the two will be used. Which one is undefined.
Pretty ominous statement...
There are several threads somewhat related to this :
How do I Integrate the Firebase cocoaPods in my custom swift framework?
Building a swift Cocoa Touch framework with Firebase as a dependency
And even an issue (#6619) filed...
But they don't have a clear resolution / answer and the issue has even been closed without any resolution.
So is there a way to use Firebase in a modular approach (using frameworks) ? If so what's the best way to make this works ? Or is the Firebase SDK too invasive to do so ?
Thanks !
Podfile :
project 'FrameWork101.xcodeproj'
platform :ios, '11.2'
target 'Binding' do
use_frameworks!
pod 'ReactiveKit'
pod 'Bond'
end
target 'Model' do
use_frameworks!
target 'ModelTests' do
inherit! :search_paths
end
end
target 'Service' do
use_frameworks!
pod 'ReactiveKit'
pod 'Bond'
end
target 'View' do
use_frameworks!
pod 'ReactiveKit'
pod 'Bond'
end
target 'Store' do
use_frameworks!
pod 'ReactiveKit'
pod 'Bond'
pod 'Firebase/Database' <---- comment this out and it works fine.
end
target 'FrameWork101' do
use_frameworks!
pod 'Firebase/Core'
pod 'ReactiveKit'
pod 'Bond'
target 'FrameWork101Tests' do
inherit! :search_paths
end
end
And part of the crash report :
This question already has answers here:
Conflicts with FlutterFire and native GeoFire plugin on iOS
(2 answers)
Closed 5 years ago.
I've got my app working with the Firebase RTDB but want to experiment with Firestore so I have followed the instructions and installed the 'firebase_firestore' plugin.
When I run my app now I get the following error:
Resolving dependencies of `Podfile`
[!] Unable to satisfy the following requirements:
- `Firebase/Firestore` required by `firebase_firestore (0.0.1)`
Specs satisfying the `Firebase/Firestore` dependency were found, but they required a higher minimum deployment target.
I've tried specifying platform :ios, '9.0' and also 10.0in my Podfile but that didn't make any difference. All other pods install fine.
Here's the entire Cocoapods run log: https://pastebin.com/raw/SBz8Bqgf
My Podfile looks like this (standard Flutter Podfile):
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end
target 'Runner' do
# Pods for Runner
# Flutter Pods
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
if File.exists? '../.flutter-plugins'
flutter_root = File.expand_path('..')
File.foreach('../.flutter-plugins') { |line|
plugin = line.split(pattern='=')
if plugin.length == 2
name = plugin[0].strip()
path = plugin[1].strip()
resolved_path = File.expand_path("#{path}/ios", flutter_root)
pod name, :path => resolved_path
else
puts "Invalid plugin specification: #{line}"
end
}
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Here's a link to the Podfile.lock, maybe that's more interesting. I see that it has not been updated with Firestore though, presumably because the run fails: https://pastebin.com/raw/hj2jHE76
In case anyone else stumbles across this issue I just wanted to expand on V. Roussel's answer (which I marked as the correct answer), since Flutter kind of abstracts away this Cocoapods process. Here's what I did to be able to run "pod repo / update":
Run pod repo update
Set the environment variable FLUTTER_FRAMEWORK_DIR to something that looks like /Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/. You can do a locate Flutter.podspec to find this directory
From YourFlutterProject/ios run pod update
After this you should be able to run your app again.
cloud_firestore has progressed to 0.03 by now, which should allow you to run the PODs.
in pubspec.yaml
cloud_firestore: "^0.0.3"
If that does not work from the start, add Firebase core to your podfile and run pod install.
Note: As far as I have seen, you cannot yet combine Firestore with other modules such as Firebase auth or Firebase analytics.
This is what happens:
running on Xcode Version 7.3.1 (7D1014)
pod 'Firebase/Core'
import Firebase in the Class
unresolved on Database
Then I added the Database framework
pod 'Firebase/Core'
pod 'Firebase/Database'
unresolved on FirebaseApp
It seems that the 2 frameworks are in mutex mode. They cannot coexist.
I have tried everything: update, install, uninstall, recreate the project, recreate the workspace. All.
May you help me. Is there a bug on last Firebase release?
I had a similar issue.
Your import statement would be:
import Firebase
Make sure restart Xcode and to clean the build folder.
It's working for me & got rid of "Use of unresolved identifier FirebaseApp..." error
Update: For Swift 4.2: FirebaseApp.configure() does work. [FIRApp is renamed to FirebaseApp]
import FirebaseCore
Then you could use FirebaseApp.configure(). I'm using swift 4.
Sounds like you might be using an older version of Firebase. Try -
pod repo update
pod update
Double check Firebase 4.0 is being installed.
Also try importing the specific modules. So instead of
import Firebase use import FirebaseDatabaseor import FirebaseAuth.
use FIRApp.configure() instead of Firebase.configure()
sudo gem install cocoapods
pod update
Replace pod 'Firebase/Core' with pod 'Firebase'.
Then run pod repo update.
That work today for me:
1. in Xcode 9.1
import UIKit
import Firebase
import UserNotifications
import FirebaseInstanceID
import FirebaseMessaging
import FirebaseCrash
import FirebaseAnalytics
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
2. My PodFile
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Crash'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
pod 'FirebaseUI', '~> 4.0'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
3. finale:
pod repo update
pod update
4. restart xcode:
5. press: shift-alt-command-k (in xcode)
This will delete all of the products and intermediate files in the build folder.It's different from delete derive data.
6. an clean
done
In my case it I needed to import FirebaseCore instead of import Firebase or import FirebaseRemoteConfig.
I put in 'Firebase' along w/ 'Firebase/Core' in the podfile and it worked for me
It worked for me with
pod repo update
pod update
and then run this at the location of the pod file:
pod install
After rebuilding my app the error should be gone.
Use FIRApp.configure() instead of FirebaseApp.
For those facing the issue with RemoteConfig configuration, adding an extra import:
import FirebaseRemoteConfig
helped in my case
import FirebaseCore
Adding this to the top of the class resolved the issue for me.
FirebaseCore version: 6.29.0
This is probably too late but if you are sure your podfile is correct and your app has been building before.
When this error just comes out of the blue, remember that the other thing can go wrong is your Xcode's incremental build folder.
Try this:
Quite Xcode
Locate your Build folder and DerivedData folder in finder
Delete Build folder and DerivedData folder
Rebuild via Xcode
Hopefully you'd be fine then.
I am trying to install the Firebase Performance SDK and following their instructions on the site:
https://firebase.google.com/docs/perf-mon/get-started-ios
When I run the pod install step it gives me the following error:
firebase performance required by podfile
I run the pod update command and everything runs on the pod install but then when I open up my workspace I get errors in swift as such:
FIRDatabaseReference has been renamed to DatabaseReference
FIRDatabase has been renamed to Database
FIRFirebase.database().reference is now Database.database.reference
which then give the error
Database has no member reference
What gives!? Has anyone gotten these error after updating their podfile with Firebase!?
Pod file is as such:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Pool' do
# Uncommnet this line if you're using Swift
use_frameworks!
#Pods for firebase pool
pod 'Firebase', '>=2.5.1' <--- This has been removed from the podfile as suggested
pod 'Firebase/Core'
pod 'Firebase/Performance'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
target 'PoolTests' do
# inherit! :search_paths
end
target 'PoolUITests' do
# inherit! :search_paths
end
end
Result of pod install
Error in xcode after pod install/update:
Here's a guide for upgrading Firebase iOS:
https://firebase.google.com/support/guides/firebase-ios
With 4.0 in particular, the Swift interfaces have been cleaned up to make it more "Swifty" which is why you're seeing those rename warning.
After the renaming, accessing the database reference should look like:
let ref:DatabaseReference = Database.database().reference()
For the updated docs of the new swift interface, see here:
https://firebase.google.com/docs/reference/ios/firebasedatabase/api/reference/Classes/FIRDatabase
The release of Firebase 4.0 on May 17 has the changed the naming convention and can be found in this naming migration guide:
https://firebase.google.com/docs/reference/ios/naming-migration-guide
I am getting EXC_BAD_ACCESS after including 'Firebase/Auth' in Podfile. This happens without adding any line of firebase code. I am using swift3 on xcode 8 and the resultant pods are -
Installing Firebase (3.8.0)
Installing FirebaseAnalytics (3.5.1)
Installing FirebaseAuth (3.0.6)
Installing FirebaseCore (3.4.4)
Installing FirebaseInstanceID (1.0.8)
Using GTMOAuth2 (1.1.4)
Using GTMSessionFetcher (1.1.7)
Using GoogleAppUtilities (1.1.2)
Installing GoogleInterchangeUtilities (1.2.2)
Using GoogleSignIn (4.0.1)
Using GoogleSymbolUtilities (1.1.2)
Installing GoogleToolboxForMac 2.1.0 (was 2.1.0)
Using Localize-Swift (1.6)
Using ProtocolBuffers-Swift (3.0.6)
Using QorumLogs (0.9)
The error comes in Thread 1 in [UIViewController(FIRAScreenClassName) fira_viewDidAppear:]:
This happens only if the pod target is itself a framework which is embedded in an app eventually.
I do have Google analytics as well. Is it because ARC is not enabled? How do I do that on xcode-8?
Any other options to try?
There appears to be a problem in the latest Firebase/Core (3.8.0) release. Even #IBDesignable was crashing with a recursive call to the method signature you mentioned.
You have a couple of options:
In Info.plist (app), set FirebaseAutomaticScreenReportingEnabled to NO (bool). This solved the problem for my running application, but IBDesignable resources caused this error on build:
file:///path/to/project/Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for UIViewController (svZ-78-1Mn): The agent crashed
You may want to temporarily downgrade to 3.7.1, for example,
pod 'Firebase/Core', '~> 3.7.1'
pod 'Firebase/Auth'
pod 'Firebase/Database'
The rest of the dependencies should take care of themselves when you run pod update.
I made a silly mistake. Never turned on Google under Authentication -> Sign in methods on Firebase
I am suspecting that the Podfile is not correct. I got into similar problem by adding Firebase dependency into a framework and I ran into the problem like this
objc[12345]: Class FIRAAppEnvironmentUtil is implemented in both
/Users/...Build/Products/Debug-iphonesimulator/SomeFramework.framework/SomeFramework
(0x105ef7fc8) and /Users/.../CurrentProject.app/CurrentProject
(0x105945108). One of the two will be used. Which one is undefined.
As mentioned in this post, you might have duplicate dependencies in different targets which could lead to weird bug like this. Adding Firebase pod into the main target and removing the Firebase pod from the framework fixed the problem for me.