I am trying to configure Firebase Crashlytics in my library project. According to Firebase its not possible to configure Crashlytics in the library project.
I am getting this error message.
Crashlytics was applied to an android-library project.
Android-library support is currently an incubating feature.
Help me if you have any solution or workaround.
I just wanted to log library project crashes in Firebase Crashlytics.
I recently worked on a library and from the get go, we knew that we won't be able to integrate an out of the box solution for this as it'll always conflict with consumer apps' implementation of the service like Firebase.
We opted for a different strategy. Handle all the crashes in the library ourselves and then heres what we do with them:
A listener set by the consumer app is notified of the error as a callback
Post the error logs to our own custom API server on next restart of the app and forward these logs onto different services like Firebase.
I understand this is not an exact solution that tells you how to use Firebase Crashlytics in a library but posting here as it gets the same work done.
Related
How to fix below error in Google Play store(React native)
Your app is using an unsafe implementation of hostname verifier. Please see this Google Help Centre article for details, including the deadline for fixing the vulnerability.
Lh/a/a/a/a/l/e$a;
Lh/a/a/a/a/l/f$a;
Your project or any libraries may use an unsafe hostname verifier. You may successfully updated this app using the same code without any error on previous time. But it is a new review strategy from google play.
If you are not sure which package is used this unsafe-hostname, you can contact google play support team using the link: https://support.google.com/googleplay/android-developer/contact/app_vuln
Don't forget to select the same Google account to which you have uploaded your project
You will receive an email within 2 or 3 business days with details of this issue, including the name of the library that used the unsafe-hostname.
You can upgrade this library to the latest version, or you can remove this if you are actually not implementing this library in your code.
I got the following detailed email from google when I contacted with the above link.
*
For example, your app is currently using the following vulnerable
implementation of HostnameVerifier:
Llib/android/paypal/com/magnessdk/network/d$1;
Llib/android/paypal/com/magnessdk/network/e$1;
My project was not using the PayPal library directly, but paypal is used by another library "braintreepayments". Actually, I am not using this library in my live project, I added this at the initial time of my project. So I commented this library in app/build.gradle, this fixed my issue.
I'm working on a company project that is already in the store for years, using Fabric. When trying to migrate to Firebase, it forces me to use AndroidX, but as the code is old this generates hundreds of errors and becomes unviable. Does anyone have an idea on how to use Firebase Crashlytics WITHOUT using AndroidX? Or does anyone know another way to avoid this error?
In historical Fabric/Crashlytics for Android documentation and various online examples there is mention of the Fabric 'apiSecret' that should be included in your fabric.properties file. However, in the latest official documentation for setup with Gradle, there is no mention of it: https://fabric.io/kits/android/crashlytics/install. It also appears that the Gradle setup is no longer using fabric.properties and instead using the apiKey defined in the AndroidManifest.xml.
What is the recommended way to handle the 'apiSecret' and 'apiKey' in Android Gradle projects?
Currently Google is making the transition from fabric/crashlytics towards firebase/crashlytics. I'd recommend you look into this guide if you're currently implementing crashlytics
https://firebase.google.com/docs/crashlytics/
If going this route, you have to download a .json file from firebase after creating an app project there and include it in your app. No key needed.
Is it possible to use Firebase Remote config in an Android library module and still allow the library consumer to use Firebase Remote Config with their own acount?
I have created an Android library that uses Firebase Remote Config to update the library configuration from my Firebase console account.
In my reference/test app that references the library I have my google-services.json in the app directory. Everything works perfectly.
I have just realised that once I provide my library to others as an aar they will potentially have their own google-services.json and use Firebase directly in their own app.
I have searched google but I'm finding it difficult to find out if this is even possible? Has anyone had experience with this setup or know how it should work? The only thing I could think of trying was moving my google-services.json into the library but I couldn't get this working.
Thanks in advance for any help!
Use of Firebase SDKs in third-party modules was never intended by the Firebase team. The SDKs all depend very heavily on a host project that's configured by the app as a whole, not by a module. In fact, you can't use the google-services plugin in the library module, only in an app module.
Remote Config is even more complicated in that it depends heavily on Analytics, which is definitely only viable as an app-level dependency (you can't have two projects collecting Analytics from a single app).
If you try really hard, you might be able to use something like Realtime Database in a third party module where all apps that use it all have access to the same database, but then you'd have to initialize a special FirebaseApp that points to your common project, and make your database world-readable, because you won't have Authentication in place to gate access to individual users.
Apparently now (I am using BOM 26.0.0, but I think it was available since some prior versions) you can ALSO setup your Firebase instance manually, instead of it being read automatically from the google-services.json.
If you dig into their code you can find overloaded methods for
FirebaseApp getInstance()
FirebaseApp getInstance(#NonNull String name)
Which you can setup manually using this overloaded method:
FirebaseApp initializeApp(#NonNull Context context, #NonNull FirebaseOptions options, #NonNull String name)
Being FirebaseOptions a builder class where you can setup your values manually.
I'm trying to use Twilio and I added the following dependency to gradle:
compile 'com.twilio.sdk:twilio:7.11.0'.
When I sync I get:
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 is ignored for ... as it may be conflicting with the internal version provided by Android.
I've seen a few questions about this, but none of them are working. I'm using OkHttp library for Http requests.
Any suggestions?
Thanks.
Twilio developer evangelist here.
We recommend that you do not use the REST API directly from your Android application, since it would mean that you would need to either embed or make available your Account SID and Auth Token. A malicious user could then intercept or decompile your application to gain access to your account. Thus, the Twilio Java library doesn't build for Android.
Instead, we recommend you make your calls to the Twilio API from a server you own and then set up the communication between your app and your server. Here is an example of how we recommend you send SMS messages with Android.