Issues embedding Firebase inside other framework - firebase

We have our own swift framework REFFramework that is using carthage to import Firebase (analytics and firestore). This is the cartfile in REFFramework:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
The REFFramework is used in the app also using carthage to import it.
In addition the app itself also imports other modules from firebase (remote config).
This is the cartfile of the app:
git ".../REFFramework"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
As far as I know carthage is designed to fully support this kind of structure. We use other frameworks also embedded in REFFramework like this such as Alamofire.
However we notice a crash in the app that does not happen when we remove the Firebase out of the REFFramework.
So it's clearly todo with the embedding of Firebase in an intermediate Framework.
The crash is happening in "0 __pthread_kill", here is a screenshot of the debugger in xCode 10.3:
I see a remark in the documentation:
Note that the Firebase frameworks in the distribution include static libraries. While it is fine to link these into apps, it will generally not work to depend on them from wrapper dynamic frameworks.
Not sure if this is releated to this issue?

Yep, the Firebase Carthage frameworks include static libraries and can only be linked to other static library frameworks.

Related

React Native and using npm modules

So this is the case: we developed a web application. Now we are developing an app in React Native with Firebase, for iOS and Android... Is there a way to make use of the npm private module that we developed for the web application? Do we need to initialise firebase/app as well in typescript? Or is it really needed to develop a seperate module for android and a separate module for iOS?
So in this npm private module there are standardized ways for our company to get and set data in firestore.
Regards, Peter
As far as I understand it, every package from npm is mapped or linked to one in the respective operating system, that is Android and iOS in your case.
Is there a way to make use of the npm private module that we developed
for the web application?
Or is it really needed to develop a seperate module for android and a
separate module for iOS?
When there is no respective implementation for the operating system, that "translates" your npm package, it will not work.
Do we need to initialise firebase/app as well in typescript?
Yes indeed, also in react native you need to initialise firebase app.
So in this npm private module there are standardised ways for our
company to get and set data in firestore.
I cannot say why you did this in a custom way, if you use the "normal" firestore methods then maybe there is still a way to reuse some code? But that is hard to say from the outside.

Crashlytics could not find the resource file generated by Google Services

Crashlytics could not find the resource file generated by Google Services.You may need to execute the :processGoogleServices Task
i read the solution from this qusetion Crashlytics could not find the resource file generated by Google Services. You may need to execute the :process<Variant>GoogleServices Task
but i didn't succeded to run this command in my unity project
./gradlew :app:processProdReleaseGoogleServices or ./gradlew :app:processDevReleaseGoogleServices
how can i run it?
A tricky bit with the Unity SDK is that because Firebase still supports versions of Unity that predate a total move to gradle (I believe 2019.4 is when Unity switched over entirely, the earliest supported version right now is 2017.4), many Android specific solutions (such as the one you linked) won't function. If you did want to try it, you can select "Export Project" in your build settings -- but I don't think this will help:
It sounds instead like you're missing Plugins/Android/FirebaseApp.androidlib or Plugins/Android/FirebaseCrashlytics.androidlib. These are generated by the Firebase plugins (obviously FirebaseCrashlytics.androidlib is specific to Crashlytics -- you won't see that one otherwise) as part of a processing step to simulate what the Play Services gradle plugin would do in a typical Android application or game.
Some things to try:
Make sure you're on a supported version of Unity (2017.4 or newer -- Firebase does not officially support alphas or betas).
Ensure that you have a valid google-services.json file added and that Crashlytics has been added to your backend (full instructions here to redownload).
Re-add FirebaseCrashlytics and ensure that you leave everything checked.
Ensure that you have the latest Crashlytics plugin (currently 7.1.0). You can download just Crashlytics now from this site, but make sure you don't mix and match versions with other Firebase plugins.
And if none of these work, sometimes small changes in build environments expose unexpected issues. Your best bet will be to file an issue here with everything you've tried.

Firebase Crashlytics NDK unstripped files

I have an SDK that uses C++ code. The SDK exports 4 different modules in a maven repo that I publish on either a local maven repo or on GitHub packages.
The apps that consume the SDK should be able to use Firebase Crashlytics and get reports of crashes in the native code as well.
The first problem I have is that I need to provide to the Firebase plugin the folders unstrippedNativeLibsDir and strippedNativeLibsDir:
firebaseCrashlytics {
nativeSymbolUploadEnabled true
unstrippedNativeLibsDir "???"
strippedNativeLibsDir "???"
}
If I go to the project where I build the SDK I can see: build/intermediates/merged_native_libs/release and build/intermediates/stripped_native_libs.
Are these the unstripped and stripped folder respectively?
Is there any documentation about what exactly those folders are supposed to contain?
Anyway if I configure the app firebaseCrashlytics to point to these folders I still need to fix another issue.
I get:
Crashlytics could not find NDK build tasks on which to depend. You many need to manually enforce task dependencies
It looks like since I'm building the libs that use the NDK in another project, then the Firebase plugin does not work.
What am I supposed to do?
Is it possible to get the Crashlytics NDK working even if I build the libraries independently with a separate project?
The only way I made it work was to build the libraries along with the app. The libraries were in separate repos anyway but I included them as sub-repositories in the app.
In this way, you solve the issue of not finding NDK build tasks on which to depend.
I know this is not the answer though

How to solve the problem with sqlite in cordova?

I'm moving the electron project to cordova. To work with sqlite I use NPM plugin sqlite-sync. In electron it worked perfectly. After porting the sources and installing the dependencies, I see an error when starting the project.
ERROR in ./node_modules/sql.js/js/sql.js
Module not found: Error: Can't resolve 'fs' in 'D:\PROJECTS\PRODUCTIONS\MOBILE\\node_modules\sql.js\js'
# ./node_modules/sql.js/js/sql.js 3:1275-1288 3:170484-170497
# ./node_modules/sqlite-sync/sqlite.js
# ./src/store/index.js
# ./src/main.js
# multi ./build/dev-client babel-polyfill ./src/main.js
how fix problem? win platform
Electron and Cordova are not the same, Electron implements the NodeJS API while Cordova uses its own API. If you want to use SqlLite in cordova you are going to have to rip out the parts that use NodeJS (if you see the word 'require' it is probably a node import -- in fact to make life easier on yourself use ES6 imports with WebPack or Browserify so that you know which code to rip out). You may be able to use a lot of node_modules with a modern build system but it is going to be a fair bit of work to move from Electron to Cordova. If you want to use SQLite, the SQLite Cordova Plugin is probably the easiest way to do this, but it is going to look a little different from the NodeJs Sqlite API.

boilerplate code for C++

I want to rewrite my old .net app based on FirebAse with the new C++ SDK, I have managed to link and compile the libraries in my VS2015 environment, but now have no idea about how to use them.
The firebase quick start here:
https://github.com/firebase/quickstart-cpp/tree/master/auth/testapp/src/desktop
doesn't really show anything.
Am I looking in the wrong place?
Cheers.
Firebase C++ only provides stub libraries as a convenience for desktop at the moment so while you'll be able to link the libraries they won't actually do anything. We have a desktop implementation of our light platform abstraction layer for internal testing only - notice we don't ship desktop MSVC or Xcode projects.
See the readme.md in the Firebase SDK zip file for more information.

Resources