EXC_BAD_ACCESS code=2 on including Firebase/Auth in Podfile - firebase

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.

Related

Building iOS with Ionic 4 and cordova google plugins

when i try to add ios as new platform to my working android ionic 4 app i get tons of these messages:
[!] Found multiple specifications for GoogleDataTransport
(3.2.0):
- /Users/haraldwiesinger/.cocoapods/repos/cocoapods/Specs/0/6/a/GoogleDataTransport/3.2.0/GoogleDataTransport.podspec.json
- /Users/haraldwiesinger/.cocoapods/repos/trunk/Specs/0/6/a/GoogleDataTransport/3.2.0/GoogleDataTransport.podspec.json
[!] Found multiple specifications for GoogleUtilities (6.4.0):
- /Users/haraldwiesinger/.cocoapods/repos/cocoapods/Specs/0/8/4/GoogleUtilities/6.4.0/GoogleUtilities.podspec.json
- /Users/haraldwiesinger/.cocoapods/repos/trunk/Specs/0/8/4/GoogleUtilities/6.4.0/GoogleUtilities.podspec.json
after reading a long time in existing tickets from github in these cordova plugins.. i found out that it has something to do with incompatible versions of the google services and the pod files the plugins are using.
i am using cordova-plugin-firebasex and cordova-plugin-googleplus.
the solution for others was to run pod update and pod install in their ios folder.. but i cant create the platform cause of these errors.. so i cant run the commands there.
i also tried to update the version of plugin.xml:
<pod name="GoogleUtilities" spec="~> 6.13.0"/>
from both plugins to the same value, but the error still exists
anyone have an idea how to fix this?
found workaround solution:
file: plugins/cordova-plugin-googleplus/plugin.xml
<podspec>
<config>
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="GoogleSignIn" spec="~> 4.4.0"/>
<pod name="GoogleUtilities" spec="~> 6.4.0"/>
</pods>
</podspec>

How to know which version of Google Firebase plugin to use in Flutter app?

I've been stuck with Gradle not building (working on iOS fine). I struggled because Gradle was giving a generic error, finally got this today:
FAILURE: Build failed with an exception.
* What went wrong: Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0. 0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid#[18.0.0], but fire base-iid version was 17.1.2.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging#18.0. 0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core#16.0.9 -- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:firebase-analytics#16.5. 0 -- Project 'app' depends on project 'firebase_remote_config' which depends onto com.google.firebase:firebase-config#16.4 .1 -- Project 'app' depends onto com.google.firebase:firebase-core#16.0.9
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
This was after I took out the version numbers from my pubspec to see if that would help. I don't understand Google's version numbering and I'm not sure which versions of plugins I should be installing as it has caused conflicts in the past:
dependencies:
flutter:
sdk: flutter
http:
cached_network_image:
flutter_cache_manager:
carousel_pro:
cloud_firestore:
firebase_core:
firebase_remote_config:
dynamic_theme:
flutter_signin_button:
shared_preferences:
share:
flutter_search_bar:
google_sign_in:
#flutter_facebook_login:
flutter_html:
requests:
webview_flutter:
flutter_webview_plugin:
firebase_analytics:
flutter_app_badger: #for launcher badge icon (notifications)
uuid:
font_awesome_flutter:
device_info:
carousel_slider:
flutter_spinkit:
flutter_typeahead:
firebase_messaging:
html_unescape:
flutter_masked_text:
configurable_expansion_tile:
stripe_payment:
square_in_app_payments:
Google doesn't seem to maintain consistent version numbering and by taking out the version numbers I thought it would at least take the latest version of the plugins which theoretically should work. So, how can I solve this?
You should begin by putting the version number back in there.
This is an issue with firebase / play services versions being mismatched so you know for sure the other plugins in your pubspec.yaml are fine.
The dependancy which is failing is firebase messaging.
It's using many words to tell you
com.google.firebase:firebase-messaging:18.0.0 package depends on com.google.firebase:firebase-iid#[18.0.0]
but it's only finding 17.1.2.
You need
com.google.firebase:firebase-core#16.0.9
com.google.firebase:firebase-analytics#16.5.0
com.google.firebase:firebase-config#16.4.1
in the future, if you are having version issues check the specific packages GitHub issues to see if there's anything currently wrong with the version you're on. This will save you a lot of time.
I wouldn't recommend removing version numbers from your pubsepc.yaml but if you type
firebase_messaging: any
It will get a compatible version for you.
The error you are getting is not necessarily from the packages you have listed in pubspec.yaml. It is referring to the dependencies on build.gradle.
Google has no issue with the version numbers. There is a difference between the versions of packages i.e what you have listed on pubspec.yaml and the dependencies on app/build.gradle. It would be wise to reconsider the number of packages you use as every package has a dependency and you may end up in a sticky situation where multiple packages are conflicting. In addition you end up with a bloated solution for minimal functionality.
Removing version numbers will not help as some packages are incompatible. I would suggest you start with the packages you require i.e the firebase which from experience have no issues then incrementally add if necessary.

How To Solve Cocapods could not find the compatible Versions

I am using Firebase latest version in my unity 2018. While build my project unity says
iOS framework addition failed due to a CocaPods installation
failure.This will will likely result in an non-functional xCode
Project.
This is my Pod file.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'Firebase/Analytics', '5.4.0'
pod 'Firebase/Auth', '5.12.0'
pod 'Firebase/Core', '5.12.0'
pod 'Firebase/Database', '5.12.0'
pod 'Firebase/Messaging', '5.9.0'
pod 'GoogleAppMeasurement', '5.3.0'
end
When i try to install pod using
pod install .
It says
[!] CocoaPods could not find compatible versions for pod
"Firebase/Auth":
In Podfile:
Firebase/Auth (= 5.12.0)
Specs satisfying the `Firebase/Auth (= 5.12.0)` dependency were
found, but they required a higher minimum deployment target.
I have update latest version of cocapods also...
But the workspace is not created..
How to solve the problem...
thanks in advance.
I have solved this issue.
1) First you have change to .net3.5 to .net 4x
2) Update dotnet4 package....(firebase messaging, Dynamic etc to dotnet4 package)
3) Go and Search Unity.Compat,Unity.Task, Unity.Compat in dotnet45 Folder. Enable With your desired package(ios,Editor,Stand alone).
4) Deselect the Unity.Compat, Unity.Task in 3.5 Version. (ios,Editor, stand alone).
By following the above method . I have solved this error.

Vuejs2 firebase with electron error

I have configured electron with vuejs and i would like to add firebae to my project so i have
In my main.js
import * as firebase from 'firebase'
let firebasconfig = {
//config from firebase project
};
Vue.prototype.$firebase = firebase.initializeApp(firebasconfig);
But now am getting an error
Error: Failed to load gRPC binary module because it was not installed
for the current system
Expected directory: electron-v1.8-linux-x64-glibc
Found: [node-v59-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module
I have tried running rebuild but still fails
What elese do i need to do for this to work
I encouter the same issue with
vue-electron 1.0.6
firebase 5.4.2
vuefire 1.4.5
node 6.10.3
The following manipulation has worked for me. I have downgraded :
firebase to 4.6.0
vuefire to 1.4.4
Then ran npm rebuild and yarn and now it works.
I'm not sure all the things I have done are necessary. But for sure it looks like a problem with firebase.

How to upgrade new Firebase app from exist old app?

There are "create new app" or "import from google project" only in new Firebase console.( https://console.firebase.google.com/ )
How to update exit old app to new one?( https://www.firebase.com/account/#/ )
---Edit
This issue looks like already fixed.
I think the cause is 500 request error on new Firebase console.
However it had fixed already.
If you are already signed in to the new Firebase Console with the same Google account as you used on firebase.com, then you should see your firebase.com project listed under "Projects currently at Firebase.com".
Follow the instructions on the new Firebase upgrade page for Web, Android or iOS.
I've had a somewhat similar problem. I see the import button but when I click it, and select the project I want to load, it only displays the spinner. Ive even tried to import JSON from an old firebase project (before the upgrades) and it just spins. Could it be that the old JSON is not what the new firebase is expecting?
EDIT
OK, seems it doesn't like Chrome. Works in IE 11 but not Chrome 50.0.2
This is how you update a Firebase < 3.0 app to Firebase 3.
Step 1
Install Regular Firebase - pod 'Firebase', '>= 2.5.1'
Or
If considering your old app is already Firebase < 3.0 you should be fine.
Step 2
Update - pod update
*At this point it will take a good couple minutes to update. You should see something like this.
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing Firebase 3.2.0 (was 3.2.0)
Using FirebaseAnalytics (3.2.0)
Installing FirebaseAuth (3.0.2)
Using FirebaseDatabase (3.0.1)
Using FirebaseInstanceID (1.0.6)
Using GoogleInterchangeUtilities (1.2.1)
Installing GoogleNetworkingUtilities (1.2.1)
Using GoogleSymbolUtilities (1.1.1)
Using GoogleUtilities (1.3.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 4 dependencies from the Podfile and 10
total pods installed.
Step 3
Now you should have Firebase 3. So you can add frameworks like such in your pod file then pod update
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'xMarket' do
end
target 'xMarketTests' do
end
target 'xMarketUITests' do
end
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Core’
pod ‘Firebase/Database’
pod ‘Firebase/Auth’
Good luck!
P.S. You will also have to edit your codebase because Firebase 3 is different than Firebase 2. Check the documentation here Firebase 3 Examples
Above answers look great. I'll just add one link that has a lot of the common differences between Firebase 2 and Firebase 3: https://firebase.google.com/support/guides/firebase-ios#get_a_database_reference_numbered
(I didn't see this at first and wasted a few hours yesterday trying to figure it all out.)

Resources